美文网首页
tableView属性

tableView属性

作者: zhouios | 来源:发表于2016-09-20 16:00 被阅读0次
// 设置tableView的背景颜色
    self.tableView.backgroundColor = [UIColor colorWithRed:222/255.0 green:222/255.0 blue:222/255.0 alpha:1];
    // 让cell不允许选中
    self.tableView.allowsSelection = NO;
    // 取消分割线
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    // 设置分割线的颜色
    self.tableView.separatorColor = [UIColor colorWithRed:100/255.0 green:255/225.0 blue:255/255.0 alpha:1];
    
    // 设置tableView最头部视图
    self.tableView.tableHeaderView = [UIButton buttonWithType:UIButtonTypeContactAdd];
    // 设置tableView最底部视图
    self.tableView.tableFooterView = [[UISwitch alloc] init];
    
    // 设置tableView的尾部视图,传一个空的可以让没有数据的cell不显示
    self.tableView.tableFooterView = [[UIView alloc] init];

相关文章

网友评论

      本文标题:tableView属性

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