美文网首页
静态TableView小结

静态TableView小结

作者: 哇很瓜皮 | 来源:发表于2017-05-25 10:49 被阅读0次
示例图片

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];

}

相关文章

网友评论

      本文标题:静态TableView小结

      本文链接:https://www.haomeiwen.com/subject/sibaxxtx.html