简体   繁体   中英

GWT's analog for Android LinearLayout's layout_weight property?

Android's LinearLayout individual children android:layout_weight attribute assigns an "importance" value to a view in terms of how much space it should occupy on the screen. A larger weight value allows it to expand to fill any remaining space in the parent view. Child views can specify a weight value, and then any remaining space in the view group is assigned to children in the proportion of their declared weight. How can I get the same children size adjustment in GWT's VerticalPanel or HorizontalPanel?

Don't think in GWT but in HTML.

I also think it is better to work with divs in this case. Maybe checkout some library like GWT bootstrap, or GWT DominoUI

I think this thread actually gives an HTML answer to what you want: Make a div fill the height of the remaining screen space

Translating this into a GWT project should be pretty straightforward.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM