简体   繁体   English

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

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

How to place close button of drawer layout such a way that ejecting half portion towards outside as seen in picture: 如图所示,如何放置抽屉布局的关闭按钮,将一半部分朝向外侧弹出:

在此输入图像描述

You'll need to use a overlay layout like Relativelayout 您需要使用像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>

Make two different horizontal layout and add the arrow button in first horizontal layout according to the position. 制作两个不同的水平布局,并根据位置在第一个水平布局中添加箭头按钮。 The remaining things add in second horizontal layout. 其余的东西添加第二个水平布局。

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

相关问题 带有关闭按钮一半的android -custom对话框 - android -custom dialog with close button half outside 在DialogFragment上的布局之外放置一个按钮 - Place a button outside my layout on DialogFragment 如何在 Android 中的 BackPress 上关闭 Drawer 布局? - How to close Drawer layout on BackPress in Android? 如何在父母布局的右上角添加两个浮动操作按钮(一半为内部布局,一半为外部),并在单击时显示 - How to add two floating action button on top-right of parrent layout (half insidelayout, and half outside), and show on click 如何在android中的一个布局上显示一半的按钮? - How to show a button half on one layout and half on another layout in android? 如何使用返回按钮关闭滑动抽屉 - android - how to close the slidind drawer with the return button - android 如何将布局按钮设计成一半一种颜色,另一半 - how to design layout button to be half one color, half other 如何将按钮放入两种布局 - How to place a button into two layout 如何只用按钮打开抽屉布局? - How to open Drawer Layout only with button? 如何在布局中设置ImageView,其中某些部分处于相同布局并在布局外部休息 - How to set a ImageView in a layout of which some portion is in same layout and rest outside the layout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM