简体   繁体   English

GWT是否适用于Android LinearLayout的layout_weight属性?

[英]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. Android的LinearLayout单个子对象android:layout_weight属性根据视图应在屏幕上占据多少空间为其分配一个“重要性”值。 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? 如何在GWT的VerticalPanel或Horizo​​ntalPanel中获得相同的子项大小调整?

Don't think in GWT but in HTML. 不要在GWT中思考,而要在HTML中思考。

I also think it is better to work with divs in this case. 我也认为在这种情况下与div更好。 Maybe checkout some library like GWT bootstrap, or GWT DominoUI 也许签出一些库,例如GWT引导程序或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 我认为该线程实际上给出了您想要的HTML答案: 使div填充剩余屏幕空间的高度

Translating this into a GWT project should be pretty straightforward. 将其转换为GWT项目应该非常简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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