UITableView-常见设置
生活随笔
收集整理的这篇文章主要介绍了
UITableView-常见设置
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
UITableView的常见设置
// 分割线颜色 self.tableView.separatorColor = [UIColor redColor];// 隐藏分割线 self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;// tableView有数据的时候才需要分割线 // 开发小技巧:快速取消分割线self.tableView.tableFooterView = [[UIView alloc] init];
UITableViewCell的常见设置
// 取消选中的样式(常用) 让当前 cell 按下无反应 cell.selectionStyle = UITableViewCellSelectionStyleNone;// 设置选中的背景色 UIView *selectedBackgroundView = [[UIView alloc] init]; selectedBackgroundView.backgroundColor = [UIColor redColor]; cell.selectedBackgroundView = selectedBackgroundView;// 设置默认的背景色 cell.backgroundColor = [UIColor blueColor];// 设置默认的背景色 UIView *backgroundView = [[UIView alloc] init]; backgroundView.backgroundColor = [UIColor greenColor]; cell.backgroundView = backgroundView;// backgroundView的优先级 > backgroundColor // 设置指示器 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryView = [[UISwitch alloc] init];
转载于:https://www.cnblogs.com/luoze/p/5467595.html
总结
以上是生活随笔为你收集整理的UITableView-常见设置的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 大专老师工资多少 相比于校外培训机
- 下一篇: bzoj4006: [JLOI2015]