0
class ViewController: UIViewController,UITableViewDataSource,UITableViewDelegate {
var names = ["jan","feb","mar"]
let image = UIImage.init(named: "dine001")
@IBOutlet weak var tableview: UITableView!
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return names.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")
cell?.textLabel?.text = names[indexPath.row]
return cell!
}
如何在firstCell添加圖像,剩下的細胞串如何在tableview中第一個單元格添加圖像,它們的其餘部分都是字符串