New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于 文字超出label范围的省略号(...)的问题 #344
Comments
试试
|
可以了, 十分感谢, 另外问一下, 这套框架可以设置一行内的字间距吗? |
刚才又试了一下YYTextTruncationTypeStart , 超过四行时显示效果为, 最后一行前后都有省略号, 设置为YYTextTruncationTypeMiddle, 超过四行, 最后一行中间和末尾都有省略号, 这个效果可能有一些问题 |
字间距用 attributedString 的 kern 属性来调节。 truncation 这个属性,多行下 start 和 middle 确实表现不对,是之前在调整 truncation 裁剪方式的时候引入的问题。这个之后会进行修复。 |
好的, 十分感谢 |
@ibireme 请问,最后的省略号可以自定义吗,我现在的做法是自己计算行数把最后一行的几个字替换成我想自定义的字,就像这种效果: |
Demo 中就有例子,可以自定义 trunctionToken。 |
不好意思, Demo中有trunctionToken 的例子吗, 没有看到, 我全局搜trunctionToken也搜不到, 搜trunction到时可以找到trunctionType, 其他的没看到 |
拼错了。。truncationToken |
谢谢,我试了下可以为YYTextContainer 设置trunctionToken来自定义截断显示,但是点击的事件不是在正常的将YYTextLayout赋值给的YYLabel里,而是在生成truncationToken的YYLbel里面 |
是的, Truncation 响应不了点击事件。 |
请问这个是否已经修复?感谢 |
如下代码, 设置了最多显示4行, 最后一行尾部没有省略号, 不知道这个怎么设置会显示出来
` NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:model.content];
attString.yy_font = [UIFont systemFontOfSize:13];
attString.yy_lineSpacing = 10;
The text was updated successfully, but these errors were encountered: