最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時(shí)間:2016年02月21日 15:24:02   作者:來碗雜醬面  
這篇文章主要介紹了ios8 UITableView設(shè)置 setSeparatorInset UIEdgeInsetsZero不起作用的解決辦法(去掉15px空白間距)的相關(guān)資料,需要的朋友可以參考下

但是在ios8中,設(shè)置setSeparatorInset:UIEdgeInsetsZero 已經(jīng)不起作用了。下面是解決辦法:

首先在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的分割線就沒有空白間距了。

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

相關(guān)文章

最新評(píng)論

扎兰屯市| 休宁县| 灌阳县| 古丈县| 清苑县| 无锡市| 鹤峰县| 尤溪县| 延安市| 墨玉县| 晋城| 泰兴市| 长丰县| 北安市| 会昌县| 枞阳县| 云安县| 大宁县| 双鸭山市| 惠州市| 米泉市| 大石桥市| 通江县| 漠河县| 宜春市| 潼南县| 天气| 桦甸市| 延寿县| 无为县| 正阳县| 景宁| 克山县| 西城区| 清涧县| 龙里县| 遵义县| 崇阳县| 怀集县| 阿瓦提县| 永靖县|