Change font size of UISegmentedControl

前端 未结 16 1842
死守一世寂寞
死守一世寂寞 2020-11-28 20:54

Can anyone please tell me how can I change the font type and size of UISegmentedControl?

16条回答
  •  时光说笑
    2020-11-28 21:03

    In swift 5,

    let font = UIFont.systemFont(ofSize: 16)
    UISegmentedControl.appearance().setTitleTextAttributes([NSAttributedString.Key.font: font], for: .normal)
    

提交回复
热议问题