2016-11-26 8 views
0

以下のコードは1から17までのセルのみを表示しています。indexPath.rowは0から16になります。

internal func tableView(_ tableView: UITableView,numberOfRowsInSection section: Int) -> Int { 

    return 20 
} 

internal func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 

    let cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier:"Cell") 


    cell.textLabel?.text=String(indexPath.row+1) 
     print(indexPath.row) 
    return cell 
}` 

出力: enter image description here

+0

Scary。破棄したデータを削除して、もう一度やり直してください。 – shallowThought

答えて

0

あなたのテーブルビューのスクロールを可能にし、あなたの出力でセルを下にスクロールしてください。

関連する問題