【问题标题】:Add another sliding drawer on the right side fail在右侧添加另一个滑动抽屉失败
【发布时间】:2012-10-10 17:33:46
【问题描述】:

我想在另一个滑动抽屉旁边添加滑动抽屉,目前我的输出是:

#1 箭头应该是我的第一个滑动抽屉

箭头 #2 是我的第二个滑动抽屉应该在的位置

我有以下代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <SlidingDrawer
        android:id="@+id/asof"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/drop_shadow"
        android:content="@+id/right_content_a"
        android:gravity="center_horizontal"
        android:handle="@+id/right_handle"
        android:orientation="horizontal" >

        <ImageView
            android:id="@+id/right_handle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/tab"
            android:text="" />

        <FrameLayout
            android:id="@+id/right_content_a"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:tag="eacomm" >
        </FrameLayout>
    </SlidingDrawer>

    <SlidingDrawer
        android:id="@+id/field_ex"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/drop_shadow"
        android:content="@+id/right_content_a"
        android:gravity="center_horizontal"
        android:handle="@+id/right_handle2"
        android:orientation="horizontal" >

        <RelativeLayout
            android:id="@+id/right_handle2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="bottom" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/tab" />
        </RelativeLayout>

        <FrameLayout
            android:id="@+id/right_content_a"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:tag="eacomm2" >
        </FrameLayout>

    </SlidingDrawer>

</LinearLayout>

有什么想法吗?蒂亚!!!

【问题讨论】:

    标签: android slidingdrawer


    【解决方案1】:

    滑块抽屉将捕获布局的完整行。因此,您将无法放置另一个滑块抽屉或任何其他需要捕获点击或焦点的视图。

    【讨论】:

      【解决方案2】:

      我已经通过创建两个滑动抽屉 XML 文件并将其绑定到主容器/布局来解决它。谢谢...

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-04-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多