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

文字下面是图片,如果文字行数不确定,如何调整页面排版 #35

Open
houyanchao opened this issue Oct 30, 2018 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@houyanchao
Copy link

文字有时候一行,有时候很多行,这样就会造成很多问题,1️⃣整个页面高度不确定 2️⃣文字下方的图片如何定位

@AJLoveChina
Copy link

@houyanchao
你如果要页面高度确定
那么就设置文字的行数为固定的, 设置 lineNum, lineHeight

{
text: "......",
fontSize: 40,
width: 544,
lineNum: 4,
lineHeight: 50
}

Demo code click here

@jasondu
Copy link
Owner

jasondu commented Mar 15, 2019

@houyanchao 现在不写海报高度也是可以的,只是没有padding,但你可以写个透明的block撑开

@jasondu
Copy link
Owner

jasondu commented Mar 15, 2019

@AJLoveChina 感谢帮忙回复

@houyanchao
Copy link
Author

@houyanchao 现在不写海报高度也是可以的,只是没有padding,但你可以写个透明的block撑开

这样会存在一个问题,文字下方的图片,没法计算定位的x、y值

@jasondu
Copy link
Owner

jasondu commented Mar 15, 2019

@houyanchao现在不写海报高度也是可以的,只是没有填充,但你可以写个透明的块撑开

这样会存在一个问题,文字下方的图片,没法计算定位的X,Y值

也是,有道理,这个功能再下个版本补上,预计周末发布

@jasondu jasondu self-assigned this Mar 15, 2019
@jasondu jasondu added the enhancement New feature or request label Mar 15, 2019
@shaobeichen
Copy link
Contributor

@houyanchao现在不写海报高度也是可以的,只是没有填充,但你可以写个透明的块撑开

这样会存在一个问题,文字下方的图片,没法计算定位的X,Y值

也是,有道理,这个功能再下个版本补上,预计周末发布

我遇到了这个问题

@houyanchao
Copy link
Author

我找到一个解决方案,在view页面中计算出文本的高度,然后在绘制的时候,用这个高度就可以。如果有偏差,稍微调整下数值

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

No branches or pull requests

4 participants