首页 > 移动平台 > 详细

IOS 8 UITableView cell lines不能靠左解决方法

时间:2014-10-22 17:20:40      阅读:453      评论:0      收藏:0      [点我收藏+]

 ios7中用以下方法可使UITableView cell lines靠左

self.tableview.separatorInset = UIEdgeInsetsZero;

但在ios8中该办法已失灵啦

经过翻阅ios8文档发现用以下两种办法即可解决该问题
方法一:
- (void) viewDidLoad { [...] self.tableView.separatorInset = UIEdgeInsetsZero; if ([self.tableView respondsToSelector:@selector(layoutMargins)]) { self.tableView.layoutMargins = UIEdgeInsetsZero; } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { [...] cell.separatorInset = UIEdgeInsetsZero; if ([cell respondsToSelector:@selector(layoutMargins)]) { cell.layoutMargins = UIEdgeInsetsZero; } }
方法二:
- (UIEdgeInsets)layoutMargins
{
    return UIEdgeInsetsZero;
}


 

IOS 8 UITableView cell lines不能靠左解决方法

原文:http://www.cnblogs.com/zhaoguowen/p/4043724.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!