android 如何构建背景渐变的页面

来源:互联网 发布:js与ajax 编辑:程序博客网 时间:2024/05/24 03:19

shape.xml:

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><gradient android:startColor="#FF123456" android:endColor="#FF654321"android:angle="270" /></shape>


 

 

 

 

style.xml:

<?xml version="1.0" encoding="utf-8"?><resources><style name="NewTheme" parent="android:Theme"><item name="android:background">@drawable/shape</item></style></resources>


 

 

配置文件:

<activity android:name=".translucent" android:label="@string/app_name"   android:theme="@style/NewTheme">


 

 

 

原创粉丝点击