YYLabel

YYLabel 继承View,功能更加强大,支持所有UILabel的特性

1.可以实现垂直文字文字布局

@property (nonatomic, getter=isVerticalForm) BOOL verticalForm;

//默认为NO(水平),Yes(垂直)

2.可以实现文字靠上,还是靠下

@property (nonatomic) YYTextVerticalAlignment     textVerticalAlignment;

typedef NS_ENUM(NSInteger, YYTextVerticalAlignment) {

YYTextVerticalAlignmentTop =    0, ///< Top alignment.

YYTextVerticalAlignmentCenter = 1, ///< Center alignment.

YYTextVerticalAlignmentBottom = 2, ///< Bottom alignment.

};//枚举

3.改变文字显示不下时候的 省略号 的显示方式

@property (nonatomic) NSLineBreakMode lineBreakMode;

省略号显示方式,是系统的一个枚举(是在中间,还是末尾,还是不显示等等)

@property (nullable, nonatomic, copy) NSAttributedString *truncationToken;

truncationToken 就是用来替换 省略号的 如(truncation=@“more”;)当文字显示不下的时候more将会代替省略号。NSAttributedString 可以设置不同的颜色,大小。

4.实现文字的容器布局

@property (nullable, nonatomic, copy) UIBezierPath *textContainerPath;

textContainerPath 是一个圆,那么文字就会放在这个贝塞尔曲线画的圆里面

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容