[英]Change color of back button in android
Cannot change the color of my back button in android.无法在 android 中更改后退按钮的颜色。 In ios, is working very well.
在ios中,运行良好。
((NavigationPage)Application.Current.MainPage).BackgroundColor = (Color)App.Current.Resources["white"];
((NavigationPage)Application.Current.MainPage).BarBackgroundColor = (Color)App.Current.Resources["white"];
((NavigationPage)Application.Current.MainPage).BarTextColor = (Color)App.Current.Resources["texto"];
Expected: back button color black.预期:后退按钮颜色为黑色。
Actual result: back button color white.实际结果:返回按钮颜色为白色。
Add a ToolbarTheme style in your Android project Resources/layout/styles.xml在你的 Android 项目Resources/layout/styles.xml 中添加 ToolbarTheme 样式
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="colorControlNormal">@android:color/black</item>
</style>
Then add android:theme="@style/ToolbarTheme"
to your Toolbar in Resources/layout/Toolbar.axml然后将
android:theme="@style/ToolbarTheme"
到Resources/layout/Toolbar.axml 中的工具栏
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.