tableView属性

// 设置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];
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容