如何创建自定义背景[关闭]

问题描述 投票:-4回答:1

我想创建一个带有阴影的自定义背景,如给定的imageenter image description here

android android-layout android-drawable android-shapedrawable
1个回答
1
投票

如果你想使用vector drawable,试试这个

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="150dp"
    android:height="80dp"
    android:viewportWidth="52.652084"
    android:viewportHeight="21.166666">
    <path
        android:fillColor="#12C7DD"
        android:pathData="M31.214,0.036 L2.229,0.027C0.332,0.026 0.104,0.811 0.101,1.862l-0.047,16.618c-0.003,1.466 -0.185,2.731 1.932,2.729L51.342,21.175c1.381,0.096 1.798,-0.748 0.581,-2.647L45.639,9.214 40.544,1.907C39.687,0.67 39.285,0.305 38.061,0.138 36.744,-0.042 34.414,0.081 31.214,0.036Z"
        android:strokeWidth="1.11766827"/>
</vector>

OUTPUT

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.