我已经在我的项目得到了这个斯威夫特代码之后,除了detaiTextLabel不showing.What是错我的代码detailTextLabel没有显示甚至设置风格的副标题
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCell(withIdentifier: cellid, for: indexPath) as? UITableViewCell
if cell == nil {
cell = UITableViewCell(style: .subtitle, reuseIdentifier: cellid)
}
let user = users[indexPath.row]
cell!.textLabel?.text=user.Name
cell!.detailTextLabel?.text = user.Email
return cell!
}
一切正常?
你有原型细胞? –
@RajeshkumarR你在谈论'tableView.register(UserCell.self,forCellReuseIdentifier:cellid)'中使用的类吗? –
你有StoryCell中的UserCell吗? –