0
我在Xamarin的UWP项目中创建了一个导航栏。如何在Xamarin中以编程方式更改导航栏的背景颜色?
App.xaml.cs
...
public app()
{
InitializeComponent();
MainPage = new NavigationPage(new LoginPage()){
BarBackgroundColor = Color.Black;
}
}
所以,如果我在设置页面,我需要以编程方式更改导航栏的颜色。
SettingPage.xaml.cs
...
private void clicked_btn(sender, e) {
...
// how can I get the handle of navigationbar and then change the attribute of one???
}
这可能吗?
有没有办法我可以做?