小编Nat*_*an 的帖子

如何在UITableViewCell中添加多行

我目前正在Swift中开发一个将数据存储到表中的应用程序.目前我在主要文本下遇到字幕文本问题.我想在"许可证号码"下添加几行字幕,请参考图像.我已准备就绪,但不确定如何让它可见.任何帮助,将不胜感激

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
    let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Value2, reuseIdentifier: "Nil")

    cell.textLabel!.text = LrnLog.logs[indexPath.row].name    //Trip Date- The data is used for the name
    cell.detailTextLabel!.text = LrnLog.logs[indexPath.row].desc    //Trip Name
    cell.detailTextLabel!.text = LrnLog.logs[indexPath.row].rego    //Vehicle Rego
    cell.detailTextLabel!.text = LrnLog.logs[indexPath.row].licnum  //License Number

    return cell
}
Run Code Online (Sandbox Code Playgroud)

图2是我的应用程序的样子

xcode uitableview subtitle swift

2
推荐指数
1
解决办法
1188
查看次数

标签 统计

subtitle ×1

swift ×1

uitableview ×1

xcode ×1