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];
}
精彩评论