0

こんにちは、タイトルのように、index.row は 4 にはならず、代わりに [2,0] に戻ります。私のtableViewには5行あります。いつ機能しなくなったのかはわかりませんが、timeIndex 行を追加する前に機能していたことは確かです。

表示に問題があるのは「ここに住所を入力してください」フィールドです

let timeIndex = 2
let DateLocation = 1
let locationIndex = 4
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {



    if userPickedDate && indexPath.row == timeIndex {
        return 50
    }
    if userPickedDate && indexPath.row == DateLocation {

        return 0

    }
    print("The indexPath: \(indexPath)")
    if remindMeOnLocationSwitch.isOn && indexPath.row == locationIndex {
        return 100

    }
    if remindMeOnDay.isOn && indexPath.row == DateLocation{
        return 300
    } else if indexPath.row == DateLocation || indexPath.row == timeIndex || indexPath.row == locationIndex  {
        return 0
    }
    return 50

}

テーブルビュー

コンソール出力

コンソール出力

4

3 に答える 3