您的位置:首页 > 移动开发 > Android开发

ANDROID笔记:shape的简单使用

2013-10-25 11:25 337 查看
/res/drawable/shape1

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

<!-- 圆角 -->
<corners android:radius="8dp" />
<!-- 填充色 -->
<solid android:color="#ff0000" />
<!-- 边框 -->
<stroke
android:width="4dp"
android:color="#00ff00" />
<!-- 内边距 -->
<padding
android:left="10dp"
android:top="10dp" />
<!-- 渐变色 -->
<gradient
android:angle="180"
android:centerColor="#0000"
android:endColor="#00ff00"
android:startColor="#ff0000" />

</shape>


使用:

android:background="@drawable/shape1"

效果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: