android是否有可能有多个SlidingDrawer

android中有很多新东西,这里有一个.

Android SlidingDrawer小部件.
真的很想在屏幕的右侧有4个.
每个人在拉出屏幕时都会填满屏幕.

我尝试在我的R.layout.main中创建其中的4个,但只有一个出现.

我在错误的道路上吗?

这是带有两个SlidingDrawer的xml文件
试图让两者都显示在右侧

<LinearLayout android:id="@+id/LinearLayout01"
              android:layout_width="fill_parent" 
              android:layout_height="wrap_content"
              xmlns:android="http://schemas.android.com/apk/res/android"
              >

 <SlidingDrawer android:id="@+id/SlidingDrawer2" 
        android:layout_width="wrap_content" 
        android:handle="@+id/slideHandleButton2" 
        android:content="@+id/contentLayout2" 
        android:layout_weight="1"
        android:layout_height="wrap_content" 
        android:orientation="horizontal">

        <Button android:id="@+id/slideHandleButton2"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:topOffset="10dip"
            android:background="@drawable/icon">
        </Button>

        <RelativeLayout 
            android:layout_width="wrap_content" 
            android:id="@+id/contentLayout2" 
            android:orientation="horizontal" 
            android:gravity="center|top" 
            android:padding="10dip" 
            android:background="#C0C0C0" 
            android:layout_height="wrap_content">

       <ImageView android:id="@+id/f" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Content"
            android:src="@drawable/arrow_top_right">>
        </ImageView>

    </RelativeLayout>
 </SlidingDrawer>


 <SlidingDrawer android:id="@+id/SlidingDrawer" 
        android:layout_width="wrap_content" 
        android:handle="@+id/slideHandleButton" 
        android:content="@+id/contentLayout" 
        android:orientation="horizontal"
        android:layout_weight="1"
        android:layout_height="wrap_content" 
        >

        <Button android:id="@+id/slideHandleButton"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:background="@drawable/icon"
            android:topOffset="40dip">
        </Button>

        <RelativeLayout 
            android:layout_width="wrap_content" 
            android:id="@+id/contentLayout" 
            android:orientation="horizontal" 
            android:padding="10dip" 
            android:background="#C0C0C0" 
            android:layout_height="wrap_content">

         <ImageView android:id="@+id/Button03" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Content"
            android:src="@drawable/arrow_top_right">
        </ImageView>
    </RelativeLayout>
 </SlidingDrawer>
</LinearLayout>

解决方法

我不认为这只是一个展示.我认为这两个显示在另一个之上.尝试偏移手柄,以便能够看到两个手柄.尝试将此属性与不同的偏移量添加到您的绘图器:

android:topOffset="10dip"

如果这不起作用,请尝试将此添加到两个slidedrawers:

android:layout_weight="1"
android:layout_height="0"

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...