国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

ios8 UITableView設置 setSeparatorInset UIEdgeInsetsZero不起作用的解決辦法(去掉15px空白間距)

2019-10-21 18:55:57
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了ios8 UITableView設置 setSeparatorInset UIEdgeInsetsZero不起作用的解決辦法(去掉15px空白間距)的相關資料,需要的朋友可以參考下
 

但是在ios8中,設置setSeparatorInset:UIEdgeInsetsZero 已經不起作用了。下面是解決辦法:

首先在viewDidLoad方法加入以下代碼:

if(leftTable!.respondsToSelector("setLayoutMargins:")){leftTable?.layoutMargins=UIEdgeInsetsZero}if(leftTable!.respondsToSelector("setSeparatorInset:")){leftTable!.separatorInset=UIEdgeInsetsZero;}

然后在UITableView的代理方法中加入以下代碼:

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {if(cell!.respondsToSelector("setLayoutMargins:")){cell!.layoutMargins=UIEdgeInsetsZero}if(cell!.respondsToSelector("setSeparatorInset:")){cell!.separatorInset=UIEdgeInsetsZero;}}

這樣不出意外的話,Table的分割線就沒有空白間距了。

以上內容給大家介紹了ios8 UITableView設置 setSeparatorInset UIEdgeInsetsZero不起作用的解決辦法(去掉15px空白間距),希望對大家以上幫助!



注:相關教程知識閱讀請移步到IOS開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 伊宁市| 子长县| 西乡县| 万盛区| 九江市| 恩施市| 崇义县| 蓝山县| 延边| 七台河市| 定结县| 香格里拉县| 新和县| 辛集市| 涿鹿县| 新沂市| 汕尾市| 云梦县| 彝良县| 红河县| 宁安市| 渭南市| 肇州县| 登封市| 水富县| 昭通市| 万山特区| 安福县| 浦北县| 绥德县| 大理市| 平邑县| 东源县| 临沭县| 蓬莱市| 石阡县| 古交市| 和平县| 溧水县| 景泰县| 虎林市|