我试图创建可绘制资源椭圆形com矩形形状?我想要精确的形状
但我得到了以下信息:
我用的是:
<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>
如何创造出我想要的形状?提前谢谢你
发布于 2015-04-16 05:57:17
试试这个:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#189B5F" />
<corners
android:topLeftRadius="15dp"
android:topRightRadius="15dp"
android:bottomLeftRadius="15dp"
android:bottomRightRadius="15dp"
/>
</shape>
发布于 2015-04-16 06:02:56
试试这个做椭圆形的。
<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>
发布于 2015-04-16 05:55:22
使用形状可绘制和对android:形状给矩形
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
</shape>
增加角点dp值可持续检查。我想给每个角落20到25 20就能给你那个形状了。为了修正,它不是椭圆形的,它是圆形的矩形。
https://stackoverflow.com/questions/29676847
复制相似问题