从底部弯曲的矩形形状

时间:2017-07-31 13:38:35

标签: android shapes

Desired shape

是否可以为组件的背景制作此形状?

2 个答案:

答案 0 :(得分:6)

我建议使用<vector> drawable。

<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="8dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">

    <path
        android:fillColor="#FFff0000"
        android:pathData="M24 24v-24h-24v24a20 36 0 0 1 24 0z"/>

</vector>

在“a”之后使用前两个数字(即a20 36)可以控制曲线的确切形状。

enter image description here

答案 1 :(得分:0)

您应该为此图片使用九个补丁。您可以使用AndroidAssetStudio从Roman Nurik创建的任何来源生成九个补丁。