Selected UIButton disappears inside selected UITableViewCell

前端 未结 5 1804
一个人的身影
一个人的身影 2021-01-06 00:39

I have a table, I have cellForRowAtIndexPath delegate for it and I have instance of UITableViewCell being created inside that method, which I return. Somewhere in cellForRow

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 01:25

    I noticed a similar issue on OS 4.0 beta where I had a UIButton in a UITableViewCell with setImage:forState:UIControlStateNormal. The button would disappear when I would return to the table view after selecting a row and pushing another table view. To overcome this, I setImage:forState:UIControlStateHighlighted on the image as well. I'm not sure if this would resolve your particular issue, but it did for me. I think also setting the button.highlighted=NO in didSelectRowAtIndexPath: might have worked as well, but I didn't try it.

提交回复
热议问题