【发布时间】:2012-08-03 19:41:22
【问题描述】:
我试图操纵它来做以下事情,但到目前为止它只会导致沮丧......以下是我想要完成的事情的糟糕描绘:
http://i.stack.imgur.com/WZOta.png
http://i.stack.imgur.com/6cEQk.png
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<ListView
android:id="@+id/android:list"
android:layout_width="wrap_content"
android:layout_height="419dp" >
</ListView>
<TextView
android:id="@+id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/FAP001"
/>
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="+1" />
</LinearLayout>
</ScrollView>
我不确定列表视图是否是要走的路。我什至不确定线性布局是否是一个好的选择。我试图让最终结果接近第二张图像上的内容。 提前致谢!!!
【问题讨论】:
-
ListView 本身就是一个滚动视图,因此不应包含在 ScrollView 中。从您的草图来看,ListView 绝对是正确的方法。
-
如果你想要的是一个在每个项目中都有几个“可配置”字段的列表视图,也许你应该考虑使用 listadapter 和 arrayadapter。检查此链接。 vogella.com/articles/AndroidListView/article.html希望就是你所需要的。
标签: android xml listview layout android-linearlayout