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

获取不到开启auto_adjust_size属性的label控件高度 #865

Open
songmatsu2020 opened this issue Dec 29, 2023 · 1 comment
Open

获取不到开启auto_adjust_size属性的label控件高度 #865

songmatsu2020 opened this issue Dec 29, 2023 · 1 comment

Comments

@songmatsu2020
Copy link

widget_set_auto_adjust_size(label, TRUE);
widget_set_tr_text(label, text);
label_resize_to_content(label,0,0xffff,0,0xffff);
h = widget_get_prop_int(label, WIDGET_PROP_H, 0);
大致代码如上,当我设置label控件的文本比较长时,实际显示是有换行显示的,但是获取label的h却还是xml文件里面的h高度。
有开启auto_adjust_size属性后,label的h不是会改变的吗,那通过widget_get_prop_int(label, WIDGET_PROP_H, 0)函数怎么拿不到改变后的h。怎么才能拿到根据文本内容长度所改变后的label的高度h。

@xianjimli
Copy link
Member

设置max_w属性试试

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