objective-c - iOS开发,一个label里有数字有汉字,怎样让数字的font比汉字大
巴扎黑
巴扎黑 2017-04-18 09:42:17
0
2
629

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

巴扎黑
巴扎黑

Antworte allen(2)
左手右手慢动作

用富文本NSMutableAttributedString

洪涛

可以用富文本的,通过富文本获取到NSMutableAttributedString对象,对于UILabel来说提供了一个属性@property(nullable, nonatomic,copy) NSAttributedString *attributedText
直接将生成的NSMutableAttributedString对象赋值给attributedText这个属性就行。

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!