【发布时间】:2014-05-09 09:05:31
【问题描述】:
我想在这个 listview 中的 listview 和图像波纹管时拥有这个 design.header。我编写了 xml 代码。我也使用了滚动视图,但是当我适配我的数组时我的 listview 的高度不会改变。我只能显示第一项列表显示。 在我的选项问题是 xml 文件 这是一个源xml文件
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/ic_launcher"
android:orientation="vertical" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="#ff0000" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/geocell" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/relativeLayout2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/relativeLayout1"
android:orientation="vertical" >
<ListView
android:id="@+id/menu_listview"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/relativeLayout2"
android:orientation="horizontal" >
<ImageView
android:id="@+id/popapshow"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/geocell" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>
【问题讨论】:
-
我猜 scrollview 只能有一个孩子我还是不太确定这个问题!请详细说明
-
这种布局有很多问题...最值得注意的是,您有一个
ListView,高度为wrap_content,另一个ScrollView内有一个ListView。总的来说,这种布局比它必须的要复杂得多。我看到很多多余的视图并没有真正做任何事情...... -
如果你放 ListView ScrollView 那么你的 ListView Scroll 不起作用,所以你不能在 ScrollView 中使用 Scrollable 视图。
-
您有什么解决方案?
标签: android android-layout android-scrollview