如何在Xamarin表单Android中更改导航栏文本颜色 [英] How to change navigation bar text color in xamarin forms android
本文介绍了如何在Xamarin表单Android中更改导航栏文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Xamarin Forms,我想在Android中更改Navigationbar的颜色. 我正在使用此代码:
Im using Xamarin Forms and i want to change color of Navigationbar in Android. Im using this code:
MainPage = new NavigationPage
{
BarBackgroundColor = Color.Lime,
BarTextColor = Color.Purple
};
MainPage = new NavigationPage
{
BarBackgroundColor = Color.Lime,
BarTextColor = Color.Purple
};
第一个属性(BarBackgroundColor
)有效,第二个属性不起作用(BarTextColor
).
The first property (BarBackgroundColor
) was worked, second property not worked (BarTextColor
).
请好心回答我.
推荐答案
您可以在app.xaml中进行设置,它将覆盖它
you can set in your app.xaml and it will override it
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="Red"/>
<Setter Property="BarTextColor" Value="White"/>
</Style>
</ResourceDictionary>
这篇关于如何在Xamarin表单Android中更改导航栏文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文