How to make table's separator line be hide

1) If just want to hide all the separator line, can set the separator line style to none; php

2) If want to hide the separator line when without data, can use the code like this: ide

UIView *view =[[UIView alloc] init];
view.backgroundColor = [UIColor clearColor];
[tableView setTableFooterView:view];
[view release];



3) If the table don't have data,and the way above maybe failed, so when in the tableview's datasource method:
tableView:numberOfRowsInSection:



we can do like this:
if (_arrResults.count == 0) {
    tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
return _arrResults.count;



4) If all the ways are failed, you must custom the cell you want.

Blues this

Reference:http://blog.csdn.net/bihailantian1988/article/details/7703322/ .net

              http://www.cocoachina.com/bbs/read.php?tid=169873&keyword=tableview%7C%B7%D6%B8%EE%CF%DF code

相關文章
相關標籤/搜索