TYAttributedLabel icon indicating copy to clipboard operation
TYAttributedLabel copied to clipboard

TYAttributedLabel 简单,强大的属性文本控件(无需了解CoreText),支持图文混排显示,支持添加链接,image和UIView控件,支持自定义排版显示

Results 79 TYAttributedLabel issues
Sort by recently updated
recently updated
newest added

我设置isWidthToFit为YES,设置固定高度,再执行sizetofit后,frame都是0。

第二次下拉刷新后通过打印TYAttributeLabel的值发现还保留了上次的文本值.然后一直往后追加...

2.6.6版本在设置text之前设置textAlignment是没有效果,不起作用的,必须先设置text,再设置textAlignment才有效果。我认为这是有问题的,不对,实际运用中都是先设置textAlignment,拿到数据后再设置text。 - (void)addAttributeAlignmentStyle:(CTTextAlignment)textAlignment lineSpaceStyle:(CGFloat)linesSpacing paragraphSpaceStyle:(CGFloat)paragraphSpacing lineBreakStyle:(CTLineBreakMode)lineBreakMode { if (lineBreakMode == kCTLineBreakByTruncatingTail) { lineBreakMode = _numberOfLines == 1 ? kCTLineBreakByCharWrapping : kCTLineBreakByWordWrapping; } [_attString addAttributeAlignmentStyle:_textAlignment lineSpaceStyle:_linesSpacing paragraphSpaceStyle:_paragraphSpacing lineBreakStyle:lineBreakMode]; } 这个方法中,后设置text的话,你的_attString都还在是nil。

图文长度超长,比如说超过5-6千字的时候内容不显示 但是图层查看器可以看到有内容

UILabel的文本展示 —————————————————————————————————————————— TYAttributedLabel的文本展示,文头和文尾的没有上下缩进,没有找到哪个属性可以进行调整

```objective-c TYImageStorage *imgStorage = [[TYImageStorage alloc] init]; imgStorage.placeholdImageName = imgName; imgStorage.size = [UIImage imageNamed:imgStorage.placeholdImageName].size; imgStorage.imageAlignment = TYImageAlignmentFill; imgStorage.imageURL = url; [label appendTextStorage:imgStorage]; ``` label 使用的还是这里设置的大小, 如何更新?

使用的: TYAttributedLabel *contentLabel = [[TYAttributedLabel alloc] init]; 创建TYTextStorage 然后 contentLabel appendTextStorage: 加了几个TYTextStorage 发现linesSpacing和textAlignment无效 但是插入图片之后又有效了,所以有一个暂时的解决方案就是 [contentLabel appendImageWithName:@"" size:CGSizeMake(0.5, 0.5)];