swift - 如何在 swift 中为 detailTextLabel 加粗文本

标签 swift uitableview detailtextlabel

cell!.textLabel?.text = vehicle["vrn"].string
cell?.detailTextLabel?.text = stateString

我想将 stateString 显示为 bold 并且还尝试使用 textLabel 而不是 detailedText 但它没有不工作。

最佳答案

您可以像这样设置detailTextLabel的字体属性:

cell.detailTextLabel?.font = UIFont.boldSystemFontOfSize(15.0)

关于swift - 如何在 swift 中为 detailTextLabel 加粗文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31725725/

相关文章:

ios - 点击 UITableViewCell 时数组索引超出范围,无论是否使用 didselectrowatindex 方法

ios - 注册自定义 TableCell xib 给我一个错误

ios - tableView cell.detailTextLabel.text 返回 nil

UITableViewCell 不显示 detailTextLabel.text - Swift

Swift 3 - 通过 UnsafeMutableRawPointer 通过引用传递结构?

ios - 如何修复文本标签阴影布局

Playground 上的 Swift 代码与实际类(class)

iOS:我可以检测设备屏幕是否打开/关闭吗?

ios - UITableView 的 LikeButton

ios - UITableViewCell 的 detailTextLabel 没有使用所有可用空间