0

我试图操纵它来做以下事情,但到目前为止它只会导致挫败感......以下是我想要完成的糟糕画图:

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>

我不确定列表视图是否是要走的路。我什至不确定线性布局是否是一个好的选择。我试图使最终结果接近第二张图像上的内容。提前致谢!!!

4

1 回答 1

1

您不能在 ScrollView 中放置 ListView。那是不可能的。因为那时 ListView 有两个选项可以滚动浏览内容,正如您所愿。这是行不通的。

了解更多信息:

https://groups.google.com/forum/m/?fromgroups#!topic/android-beginners/LRpLgGOy2Pc

如果您想拥有一个包含 3 个“部分”的 ListView,我建议您使用自定义适配器创建自己的自定义 ListView。

这是一个自定义 ListView 的示例 http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/

您可以只使用这个 ListView,只需根据自己的需要修改 Adapter 和 Row XML。

于 2012-08-06T20:38:04.850 回答