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

建议文字显示一行的时候 超出的用...显示 #169

Open
MyAcooL opened this issue Jan 15, 2020 · 1 comment
Open

建议文字显示一行的时候 超出的用...显示 #169

MyAcooL opened this issue Jan 15, 2020 · 1 comment

Comments

@MyAcooL
Copy link

MyAcooL commented Jan 15, 2020

No description provided.

@df13954
Copy link

df13954 commented Jun 17, 2020

超越一行显示....功能。可以自己修改,思路就是:在绘制文字的时候,先获取当前显示内容区域的宽度。
根据当前paint的画笔大小size,去测量文字内容的宽,和内容宽进行对比。
如果超越了,就递归截取,直到截取后文字长度+....的长度<=最大宽度。就把文字画出来就好了。

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

No branches or pull requests

2 participants