Skip to content
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

QMUILabel设置qmui_lineHeight的问题 #577

Closed
4 tasks done
CloudlessMoon opened this issue Apr 30, 2019 · 3 comments
Closed
4 tasks done

QMUILabel设置qmui_lineHeight的问题 #577

CloudlessMoon opened this issue Apr 30, 2019 · 3 comments
Labels

Comments

@CloudlessMoon
Copy link

CloudlessMoon commented Apr 30, 2019

请填写运行环境

  • 设备:模拟器
  • 系统:iOS 12.1
  • Xcode 版本:10.1
  • QMUI iOS 版本:3.1.7

请描述具体问题

使用QMUILabel的qmui_lineHeight设置行高,改变控件字号大小的时候,必须同时改变qmui_lineHeight和重新setText:才能生效,否则字体会被截取。

相关截图(断点的堆栈、控制台的 log)

被截取的情况和代码:
图片
图片
未被截取的情况和代码:
图片
图片

原因分析

QMUILabel当设置了qmui_lineHeight后采用setAttributedText:方法设置行高,但是设置qmui_lineHeight后,还是使用之前的attributedText,如下图所示:
attributedString对象:
图片
text对象:
图片
text对象的样式覆盖了attributedString对象的样式导致出现的问题

@MoLice
Copy link
Collaborator

MoLice commented May 5, 2019

请按 e771e05 修改后再尝试?下个版本将会带上这个改动。

@MoLice MoLice added the bug label May 5, 2019
@CloudlessMoon
Copy link
Author

收到

@MoLice
Copy link
Collaborator

MoLice commented May 7, 2019

已发布 3.1.9 修复该问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants