- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [[UITableViewCell alloc]initWithFrame:CGRectMake(0, 0, 320, 30)]; cell.resultTableContent.highlightedTextColor = [UIColor blackColor]; //选中后的 颜色设置 cell.resultBackgroudImg.highlightedImage = [UIImage imageNamed:@"mainbtnbg1.png"]; //选中后的 背景图片设置 //不可选 cell2.selectionStyle = UITableViewCellSelectionStyleNone; }
转载于:https://www.cnblogs.com/qingjoin/archive/2012/10/12/2721428.html
本文详细介绍了如何在iOS开发中自定义UITableViewCell的样式,包括设置单元格选中状态的颜色和背景图片,以及如何使单元格不可选。通过代码示例,读者可以了解到具体的实现方法。
598

被折叠的 条评论
为什么被折叠?



