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

关于RichText的使用问题 #15054

Open
chenpangzi opened this issue Feb 14, 2016 · 1 comment
Open

关于RichText的使用问题 #15054

chenpangzi opened this issue Feb 14, 2016 · 1 comment

Comments

@chenpangzi
Copy link

我的版本是3.7.1 ,我用了官方的RichText来做富文本内容。 RichText没有发现换行的接口,即没有单独设置宽度的接口。
为了让他自动换行, 我用了ignoreContentAdaptWithSize(false) 和 setContentSize
但是你们在格式化内容的时候, if(!_ignoreSize) { _elementRenderersContainer->setContentSize(_contentSize); } (UIRichText.cpp 403行)。 这样一来我就没有办法得到真正的高度了。

而我只知道美术允许的宽度,但是不知道策划会给我什么内容,没办法确定高度。
在我现在的版本,我能通过不改源代码既能实现换行,又能知道实际的高度呢?

@chenpangzi
Copy link
Author

if (_ignoreSize)
{
Size s = getVirtualRendererSize();
this->setContentSize(s);
}
else
{
this->setContentSize(_customSize);
}

416-424这几行代码好像是没必要的。Size s = getVirtualRendererSize();
this->setContentSize(s);

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