Skip to content

awtk中怎么让子控件自动扩张/收缩? #925

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

Open
Tracker647 opened this issue Jan 9, 2025 · 1 comment
Open

awtk中怎么让子控件自动扩张/收缩? #925

Tracker647 opened this issue Jan 9, 2025 · 1 comment

Comments

@Tracker647
Copy link

Tracker647 commented Jan 9, 2025

比如分辨率800x480, 一个大view里面放左右两个view,左边的view固定宽度200,右边的贴合屏幕右边框x=r:0, 但是同时也要贴合左边的view,相当于设置x=200 && x=r:0, 宽度通过这个布局自动计算。
上面是横向布局,纵向布局同理。

我试了下,design好像没支持这种布局方法,其他的布局方式不行:
列布局缩放一个view不会影响另一个view,会把另一个view挤出大view;
网格布局要求所有view高宽一致;
百分比布局不行,不是贴合的,也不能和绝对像素值连用,比如100%-30这样;

这个能否考虑实现?
谢谢

@xianjimli
Copy link
Member

-30 = 100%-30

参考这个文档的第8条: https://gitee.com/zlgopen/awtk/blob/master/docs/self_layouter_default.md

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