簡體   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