【问题标题】:How to create a rounded layout如何创建圆形布局
【发布时间】:2020-05-25 04:26:55
【问题描述】:

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

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

【问题讨论】:

    标签: android android-layout android-fragments android-view android-button


    【解决方案1】:

    实际上我猜你必须使用特殊的库来布局形状(对于图像中的这个形状)但是你可以使用这个代码来查看按钮

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-18
    • 2021-11-09
    • 2015-11-28
    • 2021-01-13
    • 2019-12-24
    相关资源
    最近更新 更多