在嵌套的LinearLayout中滚动浏览多个TextView

时间:2014-09-05 01:34:38

标签: android xml android-layout textview scrollbars

我的关于屏幕的xml文件..我已经完成了这个,因为我的应用程序支持不支持DialogFragments的API 9,所以我使用另一个类来显示另一个屏幕..问题是,我似乎无法滚动浏览整个页面,我的.xml包含嵌套LinearLayout也有TextViews ..我尝试将android:scrollbars="vertical"添加到主< LinearLayout&gt ;但没有任何反应..我希望有人可以帮助我,谢谢:)。

My XML file Pasted here.

2 个答案:

答案 0 :(得分:0)

使用ScrollView

包装你的根LinearLayout
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

    <!--your nested linearlayouts here-->

    </LinearLayout>

</ScrollView>

答案 1 :(得分:0)

ScrollView只能支持一个孩子。因此,将嵌套的LinearLayouts包含在单个LinearLayout中,并进一步将该父LinearLayout包含在ScrollView中。我已经为你做了这个。您可以使用此http://pastie.org/9528662