uitableview64像素

来源:互联网 发布:手机淘宝老版本官方 编辑:程序博客网 时间:2024/05/16 17:48

项目开发久了,有的时候会出现一些莫名其妙的错误,这个错误分析可以任务,单元格的高度大于零或者是设置自适应高度,具体错误信息如下:

Value must be greater than zero or UITableViewAutomaticDimension.






一般来说没有人会把单元格的高度设置的小于零,应该是在计算的过程中出现问题:

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {        return 50-100    }    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {        return 10    }

原创粉丝点击