开发者社区 问答 正文

UITableViewStylePlain UITableView 如何不显示分割线

我的UITableView是UITableViewStylePlain风格的,这样整个TableView都会被分割线分隔开,不管有没有数据,非常丑。。。
比如下图,我只有4行数据

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
}

screenshot
找了好久没有找到相关的选项,让有数据的Cell才显示分割线,没有数据的不显示。
求解一个方案。。。

展开
收起
a123456678 2016-07-19 16:46:26 2731 分享 版权
1 条回答
写回答
取消 提交回答
  • UIView *v = [UIView alloc] initWithFrame:CGRectMake(0,0,320,80)];
    tableview.tableFooterView = v;
    [v release];

    2019-07-17 19:58:32
    赞同 展开评论
问答地址: