0

我有一个布局,当内容溢出屏幕时,我希望它可以滚动。我设置了以下布局 xml。

<?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>

仪表板是用作菜单的图标集合。示例:单击我 不幸的是,第二个包含(仪表板)现在显示“损坏”。查看屏幕: 点击这里

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

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

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

4

1 回答 1

1

删除android:isScrollContainer="false", 并添加android:fillViewport="true"scrollView

于 2013-02-15T21:23:24.680 回答