2012-08-26 93 views
0

我有一个布局,当内容溢出屏幕时,我想滚动屏幕。 我有以下布局xml设置。Android ScrollView无法正常工作

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView android:id="@+id/ScrlView" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:isScrollContainer="false" 
    android:id="@+id/home_root" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="@drawable/backrepeat"> 
     <!-- Include Header --> 
     <include layout="@layout/main_header"/> 

     <!-- Include dashboard --> 
     <include layout="@layout/dashboard"/> 



</LinearLayout> 
</ScrollView> 

仪表板是用作菜单的图标的集合。示例:click me 不幸的是,第二个包含(仪表板)现在显示“已损坏”。请参阅屏幕: Click here

正如您所看到的,它看起来不像它的意图。当我删除滚动视图时,一切都很好。

我想要的是为我的仪表板仍然看起来不错,但如果需要可以滚动。 我尝试了几个设置,但都给出了相同的结果。我究竟做错了什么?

任何帮助,将不胜感激:)

+2

尝试删除了android:isScrollContainer = “假”,并添加机器人:fillViewport = “true” 以滚动视图 –

+0

太棒了,工作:) – PoeHaH

+0

虽然,它总是必须在那里? – PoeHaH

回答

1

取出android:isScrollContainer="false",并添加android:fillViewport="true"scrollView