2016-11-13 4 views
0

プログラムでtableViewCellの高さを変更したい場合は、 どうすればいいですか?tableViewCellの行の高さを設定する方法

私のtableView例: - あなたのViewControllerで

enter image description here

+0

[ストーリーボードの[カスタムセル行の高さ]設定が重複している可能性がありますonding](http://stackoverflow.com/questions/8615862/custom-cell-row-height-setting-in-storyboard-is-not-responding) – Honey

答えて

2

を経由して行の高さを設定します。

tableView.rowHeight = 88.8 

また、実装することによって、個々の行の行の高さを設定することができます。

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 
    if indexPath.row == 0 { 
     return 88.0 
    } 
    return 44.0 
} 
関連する問題