search

Home  >  Q&A  >  body text

objective-c - iOS开发,一个label里有数字有汉字,怎样让数字的font比汉字大

能否用富文本吗?怎样实现,比如说 “1时1分1秒” 怎样让里面的“1”显示为14像素,汉字显示为12像素

巴扎黑巴扎黑2771 days ago649

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 09:44:17

    Use rich text NSMutableAttributedString

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:44:17

    You can use rich text to get the NSMutableAttributedString object through rich text. For UILabel, an attribute is provided@property(nullable, nonatomic,copy) NSAttributedString *attributedText
    Just assign the generated NSMutableAttributedString object to the attribute of attributedText directly.

    reply
    0
  • Cancelreply