在 xamarin android 中更改导航栏后退按钮颜色 [英] Change navigation bar back button color in xamarin android

查看:49
本文介绍了在 xamarin android 中更改导航栏后退按钮颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,默认后退按钮颜色为白色.我需要将该后退按钮颜色更改为黑色.我尝试了很多帖子来更改导航栏的后退按钮,但没有运气.你能提出任何想法吗?这是我的主题设计.

In my application default back button color is white. I need to change that back button color to black. I am tried so many post's for changing back button of navigation bar but no luck. Can you please suggest any idea. Here is my theme design.

style.axml:

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:

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>

推荐答案

我在styles.xml中写了下面的代码

I have write below code in styles.xml

你必须在 mytheme.base 中写下一行

you have to write below line inside mytheme.base

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

你必须在上面的样式标签外面写下面的代码:

you have to write below code in out side of the above style tag:

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

这篇关于在 xamarin android 中更改导航栏后退按钮颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆