开发者

set backgroundColor for UITextField within UITableViewCell

How can I programatically change the backgroundColor of an UITextField that sits in a开发者_开发问答 UITableViewCell?

Setting the UITextField.backgroundColor doesn't seem to work.


I had the same problem. I sovled it by creating my own UITextField and adding it to the UITableViewCell, but im not sure if there's a better way to do it.


Try do it in layoutSubviews method of this cell.

- (void)layoutSubviews {
    [super layoutSubviews];
    self.textLabel.backgroundColor = [UIColor blackColor];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜