静态TableView小结

示例图片

1,设置BarButtonItem文字的样式

NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:13],NSForegroundColorAttributeName:[UIColor redColor]};//(属于NSAttributedString)

[self.navigationItem.rightBarButtonItem setTitleTextAttributes: dic forState:UIControlStateNormal];

2,去掉tableview底部多余的分割线

tableView.tableFooterView= [[UIView alloc] init];

3,设置cell以外的所有颜色(包括tableFooterView)

tableView.backgroundColor= ZTGray;

4,button的子控件居左显示

button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;

button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;

5,隐藏某一cell的分割线

cell.separatorInset = UIEdgeInsetsMake(0,0,0, cell.bounds.size.width*2);//

6,设置footerView的背景颜色

- (void)tableView:(UITableView*)tableView willDisplayFooterView:(UIView*)view forSection:(NSInteger)section {

view.tintColor = [UIColor redcolor];

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容