tset  

 

 

layout > activity.xml


<RelativeLayout 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="${relativePackage}.${activityClass}"
    android:background="@drawable/background_radius">

<android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginBottom="50dp"
    android:layout_marginTop="50dp" />

</RelativeLayout>


 

drawable >  background_radius.xml


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

<gradient
    android:angle="45"
    android:endColor="#FFFFAA"
    android:startColor="#AAFFFF" />

</shape>

參考:

[Android界面] 渐层背景怎么做

arrow
arrow
    全站熱搜

    小賢 發表在 痞客邦 留言(0) 人氣()