繁体   English   中英

相对布局和相对列表视图相对于滚动视图android

[英]relative layout and listview in relative which in scrollview android

布局的顶部有textview,button和imageview..etc等元素,但是大部分都有listview。 这是必需的,当我们滚动时,顶级元素也必须使用listview滚动。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res/com.revolage.vkcommunity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/vk_white"
android:orientation="vertical"
tools:context="com.egay.borsh.fragments.MainActivity" >

<RelativeLayout
    style="@style/ActionBarStyle"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="@dimen/activity_vertical_margin" >

    <RelativeLayout
        android:id="@+id/action_bar_relative_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="@dimen/activity_vertical_margin" >

        ......
    </RelativeLayout>

    <com.costum.android.widget.PullAndLoadListView
        android:id="@+id/main_post_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/header_linear_layout" />
</RelativeLayout>

但是,没有任何东西在滚动。

对于这种情况,您需要使用可扩展的ListView。 它的列表视图多数民众赞成在扩大。 因此,您可以将其放在ScrollView中。 对于您的pullAndReflesh自定义列表视图,您应该检查一个可扩展的对象并从中扩展您的类。 您可以在Google上找到此类。

为什么在listview里面有一个listView?

因为有时您需要使用不能与LinearLayout一起使用的适配器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM