我正在尝试在 UITableView 的动态单元格中设置 UITextField 的边框颜色。 那是代码:
UIColor *searchBorderColor = [UIColor colorWithRed:160.0/255.0
green: 160.0/255.0
blue:160.0/255.0
alpha: 1.0];
cell.searchField.layer.borderColor = [searchBorderColor CGColor];
我尝试将它放在 cellForRowAtIndexPath、willDisplayCell、didEndDisplayingCell 中 - 它不起作用。 请帮忙!
最佳答案
cell.searchField.layer.borderWidth = 5.0f;
或使用任何其他宽度值。你也可以添加圆角 corder:
cell.searchField.layer.cornerRadius = 7.0f;
关于ios - UITableViewCell 中 UITextField View 的边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16648902/