如何将两个形状结合在一起以绘制图形?

时间:2018-07-21 16:26:43

标签: android xml android-drawable shapes

基本上,我正在尝试为textview创建此边框,但我似乎无法在线找到任何内容。我尝试将两个形状合并为一个,因为那基本上是一个圆形和一个矩形,但是似乎不起作用。任何帮助都会被感激

enter image description here

1 个答案:

答案 0 :(得分:1)

在可绘制文件夹中创建此文件,并将其用作背景:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" android:padding="10dp">
    <solid android:color="@color/colorPrimary"/>
    <corners
        android:bottomLeftRadius="100dp"
        android:topLeftRadius="100dp" />
</shape>

100dp更改为您喜欢的颜色。

相关问题