扫码关注官方订阅号
能否用富文本吗?怎样实现,比如说 “1时1分1秒” 怎样让里面的“1”显示为14像素,汉字显示为12像素
用富文本NSMutableAttributedString
可以用富文本的,通过富文本获取到NSMutableAttributedString对象,对于UILabel来说提供了一个属性@property(nullable, nonatomic,copy) NSAttributedString *attributedText直接将生成的NSMutableAttributedString对象赋值给attributedText这个属性就行。
@property(nullable, nonatomic,copy) NSAttributedString *attributedText
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
用富文本NSMutableAttributedString
可以用富文本的,通过富文本获取到NSMutableAttributedString对象,对于UILabel来说提供了一个属性
@property(nullable, nonatomic,copy) NSAttributedString *attributedText直接将生成的NSMutableAttributedString对象赋值给attributedText这个属性就行。