2016年6月8日 星期三

iOS tips - Set table view separator full length

In Xcode 7 + swift 2.2 totally works for me! :)



func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    var cell = UITableViewCell()

    cell.preservesSuperviewLayoutMargins = false
    cell.separatorInset = UIEdgeInsetsZero
    cell.layoutMargins = UIEdgeInsetsZero

    return cell
}

沒有留言:

張貼留言