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

android 设置颜色渐变

2012-08-02 17:25 183 查看
1.在res/drawable/里新建XML文件(background_color.xml)

 内容:

 <?xml version="1.0" encoding="UTF-8"?>

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

    <gradient

        android:startColor="#000000"

        android:endColor="#FFFFFF"

        android:angle="90"

        />
 </shape>

 备:angle(角度)的值只可为:45  90  135 180等45的倍数

2.在res/layout里使用时:

颜色设置段:android:src="@drawable/background_color



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