2011-12-07 42 views
1

我想創建一個自定義漸變&將其應用於LinearLayout的背景。Android - 自定義標題欄漸變問題

這裏是漸變代碼:

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

我需要一個漸變如下的一個:

enter image description here

不知怎的,我沒有得到這樣的效果。我在角度方面做了什麼錯誤/我是否需要將更多屬性應用於漸變?

回答