gpt4 book ai didi

iphone - 如何更改 UITableViewCell 选定 View 的颜色?

转载 作者:行者123 更新时间:2023-11-28 18:06:59 31 4
gpt4 key购买 nike

选中单元格时如何改变灰色?

enter image description here

最佳答案

当用户点击选中的行

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath    
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0];
}

关于iphone - 如何更改 UITableViewCell 选定 View 的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11572458/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com