簡體   English   中英

如何創建圓形布局

[英]How to create a rounded layout

我想創建一個包含地圖、主圓圈按鈕和下面幾個按鈕的布局。 我發現用直線分隔地圖和下面的布局很容易。 但是,我不知道如何使用如圖所示的漂亮圓形布局來做到這一點。

有人可以指導我如何完成嗎?

演示

其實我猜你必須使用特殊的庫來布局形狀(對於圖像中的這個形狀)但是你可以使用這個代碼來查看按鈕

<ImageButton
    android:background="@drawable/shape"
    android:src="@drawable/ic_check_black_24dp" // drawable right click -> new -> vector asset
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    />


 shape.xml in drawable folder

 <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/colorAccent" />
  </shape>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM