2012-07-04 177 views
0

我已經創建了自定義標題。支持的個XML是標題欄自定義中的問題

<?xml version="1.0" encoding="UTF-8"?> 
    <resources> 
    <style name="CustomWindowTitleBackground" /> 
    <style name="CustomTheme" parent="android:Theme"> 
    <item name="android:windowTitleSize">50dp</item> 
    <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground 
    </item> 
    </style> 
</resources> 

customtitle.xml

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

<gradient 
    android:angle="90" 
    android:endColor="@color/grey7" 
    android:startColor="@color/black" /> 

<corners 
    android:bottomLeftRadius="12dp" 
    android:bottomRightRadius="12dp" 
    android:topLeftRadius="12dp" 
    android:topRightRadius="12dp" > 
</corners> 

</shape> 

得到的標題欄應該從四個角落是圓的,但它只是怒斥左上角和右上角。 如何讓它在各個角落圓潤?

+0

嘗試:startColor = 「@彩色/黑色」 黑到紅 –

+1

伊姆蘭...謝謝很多...它爲我工作 –

+0

我可以發佈它作爲答案? –

回答

0

可以使用Android:後臺控制輪效應: 例如:

改變機器人後
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 

    <gradient 
     android:angle="270" 
     android:startColor="@color/bar_more_main_start" 
     android:endColor="@color/bar_more_main_end" /> 

    <corners 
     android:bottomLeftRadius="6dip" 
     android:bottomRightRadius="6dip" 
     android:topLeftRadius="6dip" 
     android:topRightRadius="6dip" /> 

</shape>