Android 具有水平滚动视图的相对布局

Android 具有水平滚动视图的相对布局,android,layout,Android,Layout,我试图在显示在框架布局下的水平滚动视图中设置图像按钮。下面是我到目前为止所做的。但是,这会滚动所有内容,包括我的框架布局。我如何避免这种情况?或者从另一个角度来看,我试着把我的导航抽屉放下来,而不是从侧面弹出?也许有办法复制这种情况?总体目标是获得类似于旧黑莓滚动菜单的功能 <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xm

我试图在显示在框架布局下的水平滚动视图中设置图像按钮。下面是我到目前为止所做的。但是,这会滚动所有内容,包括我的框架布局。我如何避免这种情况?或者从另一个角度来看,我试着把我的导航抽屉放下来,而不是从侧面弹出?也许有办法复制这种情况?总体目标是获得类似于旧黑莓滚动菜单的功能

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".DMActivity">
    <HorizontalScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:gravity="center">
        <FrameLayout
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="900px"></FrameLayout>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/container"
            android:src="@drawable/directmessage_button"
            android:id="@+id/btn_DirectMessages"
            android:background="#0000"
            android:padding="20px"
            android:focusableInTouchMode="false" />
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/container"
            android:src="@drawable/instantmessage_button"
            android:id="@+id/btn_InstantMessage"
            android:layout_toRightOf="@+id/btn_DirectMessages"
            android:background="#0000"
            android:padding="20px"
            android:focusableInTouchMode="false"/>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/container"
            android:layout_toRightOf="@+id/btn_InstantMessage"
            android:src="@drawable/reports_button"
            android:id="@+id/btn_Reports"
            android:background="#0000"
            android:padding="20px"
            android:focusableInTouchMode="false"/>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/conference_button"
            android:id="@+id/btn_Conference"
            android:layout_toRightOf="@+id/btn_Reports"
            android:layout_below="@+id/container"
            android:background="#0000"
            android:padding="20px"
            android:focusableInTouchMode="false"/>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/account_button"
            android:id="@+id/btn_Account"
            android:layout_toRightOf="@id/btn_Conference"
            android:layout_below="@+id/container"
            android:background="#0000"
            android:padding="20px"/>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/filetransfer_button"
            android:id="@+id/btn_FileTransfer"
            android:layout_below="@id/container"
            android:layout_toRightOf="@+id/btn_Account"
            android:background="#0000"
            android:padding="20px"/>
    </RelativeLayout>
</HorizontalScrollView>
    <fragment android:id="@+id/navigation_drawer"
        android:layout_width="@dimen/navigation_drawer_width"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:name="datamotion.dmandroidclient.NavigationDrawerFragment"
        tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>

我不知道我是否理解得很好,但是我使用这个库来做水平滚动,你可以实现这个水平列表视图,在它里面放上你的图像按钮,就像你在垂直列表视图中做的一样


希望它能对您有所帮助。

您好,谢谢您的回复,这与HorizontalScrollView有什么区别?欢迎您。这就像一个普通的ListView,但是水平的,这将允许您水平滚动这个水平ListView中的项目