In my Xamarin app, I set the color of Navigation Bar (Status bar / top bar) in styles.xml page. And the color of navigation bar in all page changes to White.
styles.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#FFFFFF</item>
</style>
</resources>
Now, I just want to change the color of navigation bar in single content page to Black.
I followed this answer by pasting the code in the content page, but color didn't change.
((NavigationPage)Application.Current.MainPage).BarBackgroundColor = Color.Black;
((NavigationPage)Application.Current.MainPage).BarTextColor = Color.Black;
UPDATE
