iOS程序開發(fā)中設置UITableView的全屏分隔線的方法(不畫線)
更新時間:2016年04月13日 10:45:08 作者:張無忌!
ableView是app開發(fā)中常用到的控件,功能很強大,多用于數(shù)據(jù)的顯示。下面給大家介紹設置UITableView的全屏分隔線的兩種方法
ableView是app開發(fā)中常用到的控件,功能很強大,多用于數(shù)據(jù)的顯示。下面給大家介紹設置UITableView的全屏分隔線的兩種方法。
具體詳情如下所示:
如圖 添加如下代碼
sTableView.separatorInset = UIEdgeInsetsZero; sTableView.layoutMargins = UIEdgeInsetsZero; cell.layoutMargins = UIEdgeInsetsZero;
第二種方法如下圖
-(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; if ([_moreTableView respondsToSelector:@selector(setSeparatorInset:)]) { [_moreTableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)]; } if ([_moreTableView respondsToSelector:@selector(setLayoutMargins:)]) { [_moreTableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)]; } } -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { [cell setSeparatorInset:UIEdgeInsetsZero]; } if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { [cell setLayoutMargins:UIEdgeInsetsZero]; } }
您可能感興趣的文章:
相關文章
iOS通過UIDocumentInteractionController實現(xiàn)應用間傳文件
這篇文章主要為大家介紹了iOS通過UIDocumentInteractionController實現(xiàn)應用間傳文件示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-01-01iOS 導航欄無縫圓滑的隱藏 Navigationbar實例代碼
本文通過實例代碼給大家介紹了iOS 導航欄無縫圓滑的隱藏 Navigationbar的效果,代碼簡單易懂,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2017-11-11iOS內(nèi)存錯誤EXC_BAD_ACCESS的解決方法
iOS開發(fā),最郁悶的莫過于程序毫無征兆地就崩潰了,用bt命令打出調用棧,給出的是一堆系統(tǒng)EXC_BAD_ACCESS的信息,根本沒辦法定位問題出現(xiàn)在哪里2013-06-06