gpt4 book ai didi

安卓 : How to create oval size drawable resouce?

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:04 25 4
gpt4 key购买 nike

我正在尝试创建可绘制资源椭圆形 com 矩形形状?我想要下面的形状 enter image description here

但我得到以下信息:

enter image description here

我在用什么:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<gradient
android:startColor="#36D53D"
android:centerColor="#36D53D"
android:endColor="#36D53D"
android:angle="90"/>
<padding android:left="3dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" />

<corners android:radius="160dp"></corners>
</shape>

如何创建我想要的形状?提前谢谢你

最佳答案

试试这个椭圆形的。

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >

<!-- fill/color -->
<solid
android:color="#ff0000"/>

<!-- Control the width and height of the shape -->
<size
android:width="120dp"
android:height="70dp"/>
</shape>

圆角矩形

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<!-- fill/color -->
<solid
android:color="#ff0000"/>

<!-- Control the width and height of the shape -->
<size
android:width="200dp"
android:height="70dp"/>

<!-- Control the radius of each corners -->
<corners
android:topLeftRadius="30dp"
android:topRightRadius="15dp"
android:bottomLeftRadius="15dp"
android:bottomRightRadius="15dp"/>
</shape>

关于安卓 : How to create oval size drawable resouce?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29676847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com