简体   繁体   中英

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>

    <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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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