I'm using the following code for change the background color of the toolbar. It working fine with the simulator. After converting it to APK the background color is not shown. Please help me to find out the result.
Thanks @Leijae I got the solution actually the project was created an year ago. So it was old version project. So only some compatibility issues were occured. So now I've created a new project. Thanks
I don't see any of your code, but I use
<Style TargetType ="NavigationPage">
<Setter Property="BarBackgroundColor" Value="#7698f3"></Setter>
<Setter Property="BarTextColor" Value="#ffffff"></Setter>
@Leijae It's working with my simulator. Once i build the APK and install it.. It doesn't work
From this thread, https://forums.xamarin.com/discussion/95943/how-to-change-navigation-bar-background-color-for-each-content-page
What happens if you use
((NavigationPage)Application.Current.MainPage).BarBackgroundColor = Color.Black;
((NavigationPage)Application.Current.MainPage).BarTextColor = Color.OrangeRed;
in your page constructor?
@Leijae It produces the following exception. System.NullReferenceException: Object reference not set to an instance of an object. At the first line. This is line...((NavigationPage)Application.Current.MainPage).BarBackgroundColor = Color.Black;
Sorry ignore my last comment. Only the BarTextColor is working . BarBackgroundColor is not working
glad you got it worked out. actually my next quest was going to be, what version of xf are you on
Here it is.
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies