首页 > 代码库 > iOS:改变UITableViewCell的选中背景色
iOS:改变UITableViewCell的选中背景色
要改变UITableViewCell选中时的背景色,需要在
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)方法中添加如下代码:
// 设置cell选中的背景色UIView *selectionColor = [[UIView alloc] init];selectionColor.backgroundColor = [UIColor colorWithRed:(2/255.0) green:(94/255.0) blue:(130/255.0) alpha:1];cell.selectedBackgroundView = selectionColor;
即可。
iOS:改变UITableViewCell的选中背景色
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。