UITableView-常见设置
生活随笔
收集整理的這篇文章主要介紹了
UITableView-常见设置
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
UITableView的常見設(shè)置
// 分割線顏色 self.tableView.separatorColor = [UIColor redColor];// 隱藏分割線 self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;// tableView有數(shù)據(jù)的時候才需要分割線 // 開發(fā)小技巧:快速取消分割線self.tableView.tableFooterView = [[UIView alloc] init];?
UITableViewCell的常見設(shè)置
// 取消選中的樣式(常用) 讓當(dāng)前 cell 按下無反應(yīng) cell.selectionStyle = UITableViewCellSelectionStyleNone;// 設(shè)置選中的背景色 UIView *selectedBackgroundView = [[UIView alloc] init]; selectedBackgroundView.backgroundColor = [UIColor redColor]; cell.selectedBackgroundView = selectedBackgroundView;// 設(shè)置默認(rèn)的背景色 cell.backgroundColor = [UIColor blueColor];// 設(shè)置默認(rèn)的背景色 UIView *backgroundView = [[UIView alloc] init]; backgroundView.backgroundColor = [UIColor greenColor]; cell.backgroundView = backgroundView;// backgroundView的優(yōu)先級 > backgroundColor // 設(shè)置指示器 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryView = [[UISwitch alloc] init];?
轉(zhuǎn)載于:https://www.cnblogs.com/luoze/p/5467595.html
總結(jié)
以上是生活随笔為你收集整理的UITableView-常见设置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 大专老师工资多少 相比于校外培训机
- 下一篇: 华夏万家余额变成负数怎么回事 债权人摇身