我想在的LinearLayout这是滚动视图分配重量,但滚动型是忽略了布局权重如何解决这一这里是我的main.xml code 如果我尝试在布局分配的权重是不行的 我试图分裂我的邮件布局2 1 1,但没有在滚动视图工作 如果我删除滚动视图 感谢andvance
main.xml中
<滚动型的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:ID =@ + ID / scrollView1
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
<的LinearLayout
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:方向=垂直
机器人:weightSum =4>
<的LinearLayout机器人:ID =@ + ID /标志
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:方向=垂直
机器人:layout_weight =2
机器人:后台=#FFFFFF>
< / LinearLayout中>
<的LinearLayout机器人:ID =@ + ID / LOGO1
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:方向=垂直
机器人:layout_weight =1
机器人:后台=#000000>
< / LinearLayout中>
<的LinearLayout机器人:ID =@ + ID / logobutton
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:方向=横向
机器人:layout_weight =1
机器人:后台=#4B4B4B>
< / LinearLayout中>
< / LinearLayout中>
< /滚动型>
解决方案
我以前也遇到了这个问题。只需使用安卓fillViewport =真正的
在你的滚动视图,它会填满屏幕。
<滚动型的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:ID =@ + ID / scrollView1
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:fillViewport =真正的>
i want to assign weight in linearlayout which is in scrollview but scrollview is ignore the layout weight how to solve this here is my main.xml code if i am try to assigning the weight in layout is not work i am trying to divide my mail layout in 2 1 1 but is not work in scroll view if i am removing scrollview thanks in andvance
main.xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="4">
<LinearLayout android:id="@+id/logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="2"
android:background="#FFFFFF">
</LinearLayout>
<LinearLayout android:id="@+id/logo1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:background="#000000">
</LinearLayout>
<LinearLayout android:id="@+id/logobutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:background="#4B4B4B">
</LinearLayout>
</LinearLayout>
</ScrollView>
解决方案
I have faced this problem before. Just Use android:fillViewport="true"
in your scrollview and it will fill up the screen.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >