YYLabel

作者: 给伤的你我依然喜欢 | 来源:发表于2017-07-04 11:47 被阅读408次

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 是一个圆,那么文字就会放在这个贝塞尔曲线画的圆里面

相关文章

  • YYLabel富文本显示

    YYLabel实现方式 //1.简单显示label YYLabel *label = [YYLabel new];...

  • iOS YYText之YYLabel源码阅读(一)

    我用以下几个问题去阅读YYLabel的源码:问题1:YYLabel如何刷新?问题2:YYLabel动态高度计算?问...

  • YYLabel简单使用

    最近尝试研究了一下YYLabel,学习了一下YYLabel文本响应点击及YYLabel换行功能,下面介绍一下我的收...

  • YYLabel 给超出文字变成省略号

    最近研究了一下yylabel,遇到一个问题 yylabel.lineBreakMode = NSLineBreak...

  • YYLabel富文本

    YYLabel与UILabel对表情的支持YYLabel只支持YYTextAttachment,不支持系统默认的N...

  • YYKit框架学习之YYLabel

    一、YYLabel 强大的富文本显示功能,可根据文字的range随意添加点击事件 1 自动换行 YYLabel *...

  • iOS-文本内容展开/收起实现方案

    方案1:YYLabel 问题:YYLabel继承于UIView不支持项目本身的自定义表情,UILabel能正常显示...

  • YYLabel

    YYLabel 继承View,功能更加强大,支持所有UILabel的特性 1.可以实现垂直文字文字布局 @prop...

  • YYKit--YYLabel源码分析

    一、YYLabel实现的总体思路 其实YYLabel主要就是为了实现异步绘图,提高性能,为此做了好多东西。 1、使...

  • YYLabel 图片消失坑

    点击文本跳转到其他界面,突然发现YYLabel控件上的图片消失了 解决办法:重新赋值给YYLabel控件attri...

网友评论

      本文标题:YYLabel

      本文链接:https://www.haomeiwen.com/subject/htwthxtx.html