繁体   English   中英

如图所示,如何将抽屉布局的关闭按钮朝向外侧弹出半部分

[英]How to place close button of drawer layout such a way that ejecting half portion towards outside as seen in picture

如图所示,如何放置抽屉布局的关闭按钮,将一半部分朝向外侧弹出:

在此输入图像描述

您需要使用像Relativelayout这样的叠加布局

<RelativeLayout>

    <View
        android:layout_width="16dp"
        android:layout_height="16dp"
        android:layout_marginTop="48dp"(40 is height of view at top plus 8dp is half height of this own view)
        android:marginLeft="8dp" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:marginLeft="16dp">

        <View
            android:layout_width="wrap_content"
            android:layout_height="40dp" />

        <View
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </LinearLayout>

</RelativeLayout>

制作两个不同的水平布局,并根据位置在第一个水平布局中添加箭头按钮。 其余的东西添加第二个水平布局。

暂无
暂无

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

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