2016-06-21 11 views
0
の範囲外である

セル内部の私のラベルは、制約のため、このラベルがセル

enter image description here

私のコードのように見えますが、この

repoName.leadingAnchor.constraintEqualToAnchor(contentView.leadingAnchor, constant: 10).active = true 
    repoName.topAnchor.constraintEqualToAnchor(contentView.topAnchor, constant: 10).active = true 

    descriptionTextTop = descriptionText.topAnchor.constraintEqualToAnchor(repoName.bottomAnchor, constant: 10) 
    descriptionTextTop!.active = true 
    descriptionText.leadingAnchor.constraintEqualToAnchor(contentView.leadingAnchor, constant: 10).active = true 
    descriptionText.bottomAnchor.constraintEqualToAnchor(contentView.bottomAnchor, constant: 10).active = true 

のようなものです、それは私が持っているテーブルビュー

tableView.estimatedRowHeight = 44 

なぜこれが起こりますか?

答えて

0

1)セル

2に対して、ラベルが上部と下部の余白の制約があることを確認してください)自動寸法を使用するようにテーブルビューを教える:tableView.rowHeight = UITableViewAutomaticDimension

3)はあなたがまた、ラベルのを設定することもできます1000年

に垂直コンテンツの圧縮抵抗の優先順位そして、それは、ところであなたは制約を加えるプログラムではなく、Interface Builderでそれをやっている理由はいかなる理由が

を動作するはず?

関連する問題