开发者社区> 问答> 正文

自定义UITableViewCell的textLabel字体颜色

我看应用的情况,UITableViewCell的textLabel的textColor是自动控制的,而且好像是根据backgroundColor来判断的。
这个textLabe的textColor能不能像UITableViewCell的backgorundView和selectBackgroundView的方式来设置

展开
收起
a123456678 2016-07-19 17:04:37 2437 0
1 条回答
写回答
取消 提交回答
  • cell的textLabel是可以自定义textColor,还有highlightedTextColor,这就是两种状态。

    // Customize the appearance of table view cells.

    • (UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
      {

    if(0 == indexPath.row)
    {

    cell.textLabel.textColor = ...;
    cell.textLabel.highlightedTextColor = ...;

    }
    ...
    }

    2019-07-17 19:58:34
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载