- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//设置为透明色
[self.lookOverTableViewcellForRowAtIndexPath:indexPath].selectionStyle
= UITableViewCellSelectionStyleNone;
//设置为蓝色
[self.lookOverTableView cellForRowAtIndexPath:indexPath].selectionStyle
= UITableViewCellSelectionStyleBlue;
//设置为灰色
[self.lookOverTableView cellForRowAtIndexPath:indexPath].selectionStyle
= UITableViewCellSelectionStyleGray;
}
本文介绍如何在UITableView中自定义选中行的背景颜色,包括设置为透明、蓝色和灰色,通过调整UITableViewCellSelectionStyle属性实现。
1039

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



