2014-09-05 61 views
1

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

My XML file Pasted here.

+0

使用滚动型。 – 2014-09-05 02:06:33

+0

你可以使用支持库在你的代码中添加对话框片段 – 2014-09-05 02:07:30

+0

当我在主LinearLayout和第二个LinearLayout之间添加一个ScrollView ..这就是出现, 在呈现期间引发异常:ScrollView只能托管一个直接子 – n00b 2014-09-05 02:27:21

回答

0

ScrollView只能支持一个孩子。因此,将嵌套的LinearLayout放入一个LinearLayout中,并将该父LinearLayout放入一个ScrollView中。我为你做了这个。您可以使用此http://pastie.org/9528662

+0

我没有尝试过自己,和它的工作! .. 谢谢 :) – n00b 2014-09-06 00:33:40

0

裹根的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> 
+0

当我添加的主要的LinearLayout和第二的LinearLayout ..这是什么出现异常渲染过程中提出的之间的滚动型:滚动型只能承载一个直接子 – n00b 2014-09-05 02:27:41