赞
踩
Android背景颜色放射渐变可以通过在res/drawable里定义一个xml文件(xml文件名称可根据个人定义):
- <?xml version="1.0" encoding="utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
-
- <gradient
- android:startColor="#95C5F3"
- android:centerColor="#C36E6E"
- android:endColor="#C3E89B"
- android:type="radial"
- android:centerX="0.5"
- android:centerY="0.5"
- android:gradientRadius="200dp"/>
-
- </shape>
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".ColorActivity"
- android:orientation="vertical"
- android:background="@drawable/radial_gradient">
-
-
- </LinearLayout>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。