我正在做一个非常简单的tableview(只是为了测试)(使用xcode9.1,swift4) 当我模拟行之间的行不是正确的分布。某些行之间会有一条线,有些行之间没有一条线。 here is a screen shoot 谢谢你的帮助... 这是代码:
import UIKit
class ViewController: UIViewController,UITableViewDelegate,UITableViewDataSource {
let list=["milk","honey","bread","tomatoes"]
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return (list.count)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell=UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "cell")
cell.textLabel?.text = list[indexPath.row]
return (cell)
}
}