滚动视图和嵌套滚动视图不起作用

时间:2020-01-22 05:28:10

标签: android scrollview

我在滚动视图中使用这种滚动视图, 嵌套滚动视图都不起作用

<RelativeLayout>
<scrollview>
 <LinearLayout>
   <LinearLayout> 
   </LinearLayout>
   <LinearLayout> 
   </LinearLayout>
 </LinearLayout>
</scrollview>  
</RelativeLayout>

在scorll视图中,我正在尝试fillviewport,垂直滚动条也是如此,但都无法正常工作。我在片段里面做。

1 个答案:

答案 0 :(得分:0)

在我的代码中效果很好,

您可以尝试以下方法:

 <ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:fillViewport="true"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            //Your Widgets....

        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

           //Your Widgets....

        </LinearLayout>
     </LinearLayout>
   </ScrollView>
相关问题