xcode5的时候是加这句代码[self.tableView setSeparatorInset:UIEdgeInsetsZero];
现在这样操作就可以吧
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0) {
cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
}
还是自己画个线呢
隐藏自带的线
_tableView.separatorStyle = UITableViewCellSeparatorStyle.None
<pre class="brush:objc; toolbar: true; auto-links: false;">
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
// view的y是行高减view的高度
var line: UIView = UIView(frame: CGRectMake(0, 50 - 1, tableView.frame.width, 1))
line.backgroundColor = UIColor.blackColor()
cell?.contentView.addSubview(line)
}
</pre>