iOS8 - constraints ambiguously suggest a height of zero

前端 未结 18 1842
青春惊慌失措
青春惊慌失措 2020-12-02 14:15

Has anyone got any idea how to debug this?

Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview c

18条回答
  •  死守一世寂寞
    2020-12-02 14:49

    In Swift forcing a return height fixed my problem:

    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        if(indexPath.row == 0){
           return CGFloat(131.0)
        }else if(indexPath.row == 8){
           return CGFloat(97.0)
        }else{
           return CGFloat(44.0)
        }
    }
    

提交回复
热议问题