扫码关注官方订阅号
我的UITableView是UITableViewStylePlain风格的,这样整个TableView都会被分割线分隔开,不管有没有数据,非常丑。。。 比如下图,我只有4行数据
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return 4; }
找了好久没有找到相关的选项,让有数据的Cell才显示分割线,没有数据的不显示。 求解一个方案。。。
走同样的路,发现不同的人生
将UITableView的separatorStyle属性设置为UITableViewCellSeparatorStyleNone即可,如下:
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
设置每个section里面的行数试试
UIView *v = [UIView alloc] initWithFrame:CGRectMake(0,0,320,80)]; tableview.tableFooterView = v; [v release];
self.table.tableFooterView = [[UIView alloc] init];
每个Cell下面添加一条自己写的直线
[tableview setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
PHP学习
技术支持
返回顶部
将UITableView的separatorStyle属性设置为UITableViewCellSeparatorStyleNone即可,如下:
设置每个section里面的行数试试
self.table.tableFooterView = [[UIView alloc] init];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
每个Cell下面添加一条自己写的直线
[tableview setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];