0
Lyndaの「Learn Swift 2:The Basics」コースを通過します。現在、私のテーブルビューで問題が発生しています。テーブルビューコントローラーには15行しか表示されません
例:NumberOfRowsInSection関数を31に設定したにもかかわらず、アプリには15行しか表示されません。実行中のコードは次のとおりです。
import Foundation
import UIKit
class DaysTableViewController: UITableViewController {
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 31
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Basic")!
cell.textLabel?.text = "\(indexPath.row + 1)"
return cell
}
}
何が原因なのでしょうか?
ご協力いただきありがとうございます。
デバッグを試しましたか? – renjithr
スクリーンショットを投稿できますか? –
あなたのコードは完璧です。私はそれをチェックした。 –