android shapDrawable
来源:互联网 发布:php cgi not found 编辑:程序博客网 时间:2024/06/07 01:56
定义一个shapDrawable
<span style="font-size:18px;background-color: rgb(255, 255, 255);"><?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <!-- 定义填充的颜色--> <solid android:color="@color/red"/> <!-- 定义距离内容的长度--> <padding android:bottom="7dp" android:left="7dp" android:right="7dp" android:top="7dp"/> <!-- 边框的长度和颜色--> <stroke android:color="@color/blue" android:width="3dip"/> <!-- 四角的弧度--> <corners android:radius="3dp"/></shape></span>
<span style="font-size:18px;background-color: rgb(255, 255, 255);">需要使用的时候设置为某个组件的背景就可以了,</span>
<span style="background-color: rgb(255, 255, 255);"> <TextView android:id="@+id/text_view_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" android:background="@drawable/shape_drawable"/></span>
定义渐变颜色:
<gradient android:angle="45" android:startColor="@color/yellow" android:endColor="@color/pink"/>
然后效果是这样的:
0 0
- android shapDrawable
- Android
- android
- Android
- android
- android
- Android
- Android
- android
- android
- android
- Android
- Android
- android!!!
- android
- android
- android
- android
- 循环栈队列
- centos mysql yum 安装
- android TextView相关
- iOS autolayout和sizeclass
- MyEclipse 2015 CI 12下载+更新
- android shapDrawable
- 更换openjdk 为 oracle jdk
- ios 随机数
- Nodejs开发之接口
- App Store Review Guidelines
- Wrong FS: hdfs://localhost:9000/home/hadoop/hadoop, expected: file:///
- Android.mk文件解读
- 有关C#中in.Parse()和int.TryParse()的一点思考
- 两个布局之间加横线(例如两个textview之间)