[英]Android percentage layout
我想创建一个具有两个LinearLayout(垂直位置)的布局。
第一个linearLayout占空间的80%,另外20%(我使用weightSum = 10)。
在第二个布局上,我有一个文本输入,当键盘出现时,屏幕尺寸减小,因此第二个线性布局有20%太小。
我希望我的secondLayout有最小100dp和第一个布局来完成其余的但我不知道如何实现它。
谢谢 !
当总和大于LinearLayout时,权重用于分配剩余的空白空间或占用空间。 将宽度设置为0dip,它将起作用。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum:"10" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="8" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="2">
</LinearLayout>
</LinearLayout>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.