logo
  • 教程列表
  • SO官方文档
  • UIButton
    • 将方法附加到按钮
    • 创建 UIButton
    • 设置标题
    • 设置标题颜色
    • 水平对齐内容
    • 获得标题标签
    • 禁用 UIButton
    • 通过代码向 UIButton 添加操作(以编程方式)
    • 设置字体
    • 严格根据文本和字体获取 UIButtons 大小
    • 设置图像
  1. StackOverflow 文档
  2. iOS 教程
  3. UIButton
  4. 设置字体

设置字体

Created: November-22, 2018

迅速

myButton.titleLabel?.font =  UIFont(name: "YourFontName", size: 20)

目标 C.

myButton.titleLabel.font = [UIFont fontWithName:@"YourFontName" size:20];
  • 严格根据文本和字体获取 UIButtons 大小
  • 通过代码向 UIButton 添加操作(以编程方式)

Copyright © 2018. All right reserved

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

  • 关于我们
  • 免责声明