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

文本较长时,滑动到底部会有很大的间距 #11

Open
GuangNian10000 opened this issue Apr 13, 2022 · 2 comments
Open

文本较长时,滑动到底部会有很大的间距 #11

GuangNian10000 opened this issue Apr 13, 2022 · 2 comments

Comments

@GuangNian10000
Copy link

image

@GuangNian10000
Copy link
Author

切换到原生对齐则正常

@GuangNian10000
Copy link
Author

解决办法:
在drawTextWithJustify方法中 currentLineOffsetY += getLineHeight(); 替换为:
if(text_str.substring(layout.getLineStart(i), layout.getLineEnd(i)).contains("\n")){
currentLineOffsetY += 2*getLineHeight();
}else{
currentLineOffsetY += getLineHeight();
}
把段高度设置为行高度段两倍来填充多余的空白。不知道会不会有显示不全的bug先用着吧

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

1 participant