UITableViewCell Separator disappearing in iOS7

前端 未结 30 739
轮回少年
轮回少年 2020-12-07 08:31

I have some strange issue with UITableView only in iOS 7.

UITableViewCellSeparator disappears above the first row and below the last row. S

30条回答
  •  暖寄归人
    2020-12-07 09:04

    I also had the problem with missing separator and I found out that the problem only occured when heightForRowAtIndexPath was returning a decimal number. Solution:

    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        return ceil(yourHeight) // Ceiling this value fixes disappearing separators
    }
    

提交回复
热议问题