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

  • 關於本站
  • 免責聲明