logo
  • 教程列表
  • SO官方文档
  • UILabel
    • 创建一个 UILabel
    • 行数
    • 设置字体
    • 文字颜色
    • 尺寸适合
    • 背景颜色
    • 文字对齐
    • 计算内容界限(即动态单元格高度)
    • 标签归属文本
    • 为文本添加阴影
    • 使用约束可变高度
    • LineBreakMode
    • 可点击标签
    • 更改现有标签中的文本
    • 自动调整大小标签以适合文本
    • 未知文本长度的动态标签框架
    • 证明文字
    • 严格根据文本和字体获取 UILabels 大小
    • 突出显示和突出显示的文本颜色
  1. StackOverflow 文档
  2. iOS 教程
  3. UILabel
  4. 背景颜色

背景颜色

Created: November-22, 2018

迅速

label.backgroundColor = UIColor.redColor()

label.backgroundColor = .redColor()

Swift 3

label.backgroundColor = UIColor.red

Objective-C

label.backgroundColor = [UIColor redColor];
  • 文字对齐
  • 尺寸适合

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明