更新时间:2022-11-17 12:30:13
我以前也遇到了这个问题。只需使用安卓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" >