如何创建圆形布局

问题描述 投票:0回答:1

我要创建一个布局,其中包含地图,主圆圈按钮和下面的几个按钮。我发现用直线分开下面的地图和布局来创建它很容易。但是,我不知道如何使用如图所示的圆润布局来做到这一点。

有人可以指导我如何完成吗?

demo

android android-layout android-fragments android-view android-button
1个回答
0
投票

实际上我想您必须为布局形状(对于图像中的该形状)使用特殊的库,但是您可以将此代码用于按钮视图

<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:text="Hello World!"
    android:layout_centerInParent="true"
    />


 shape.xml in drawable file

 <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/colorAccent" />
  </shape>
© www.soinside.com 2019 - 2024. All rights reserved.