2017-09-15 200 views
0

在我的应用程序中,默认后退按钮颜色为白色。我需要将后退按钮颜色更改为黑色。我尝试了很多帖子来改变导航栏的后退按钮,但没有运气。你能提出一些建议吗?这是我的主题设计。在xamarin中更改导航栏后退按钮颜色android

style.axml:

<resources> 
    <style name="MyTheme" parent="MyTheme.Base"> 
    </style> 
    <style name="Theme.Splash" parent="@android:style/Theme.NoTitleBar.Fullscreen">   
    <item name="android:windowBackground">@drawable/Splash</item> 
    <item name="android:windowNoTitle">true</item> 
    </style> 
    <style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> 
    <item name="colorPrimary">@color/primary</item> 
    <item name="colorPrimaryDark">@color/primaryDark</item> 
    <item name="colorAccent">@color/accent</item> 
    <item name="android:windowBackground">@color/window_background</item> 
    </style> 
</resources> 

styles.xml:

<resources> 
    <style name="MainTheme" parent="MainTheme.Base"> 
    </style>  
    <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">  
    <item name="windowNoTitle">true</item> 
    <item name="windowActionBar">false</item>  
    <item name="colorPrimary">#fcce47</item>  
    <item name="colorPrimaryDark">#000000</item>  
    <item name="colorAccent">#000000</item>  
    <item name="windowActionModeOverlay">true</item> 
    <item name="android:textCursorDrawable">@null</item> 
    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item> 
    </style> 

    <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog"> 
    <item name="colorAccent">#FF4081</item> 
    </style> 
</resources> 
+0

您可以通过导航BarTextColor属性来更改它。无需将其添加到主题中。 –

+0

嗨,我想更改导航栏的按钮颜色而不是文本颜色。 – Deepak

+0

导航后退按钮和标题颜色将由BarTextColor属性更改。后退按钮和标题具有相同的颜色。 –

回答

0

我有下面的代码写在styles.xml

你必须写下面行内mytheme.base

<item name="drawerArrowStyle">@DrawerArrowStyle</item> 

你有在上面的样式标签的外面写代码如下:

<style name = "DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> 
<item name="color">@color/BackButtonColor</item> 
</style>