FreshMvvm
FreshMvvm copied to clipboard
Not Able to change the menu icon color and bar background color.
Hi, Im Not able to change the Menu icon color of FreshMasterDetailNavigationContainer and also the bar background color of detailed pages.
It would also be good if you could change the text color. Like in FreshNavigationContainer:
Example:
var basicNavContainer = new FreshNavigationContainer(page) { BarBackgroundColor = Color.Black, BarTextColor = Color.White };
In iOS now you can make:
UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(54, 44, 153); UINavigationBar.Appearance.TintColor = UIColor.White; UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes { TextColor = UIColor.White });
see my answer here. https://github.com/rid00z/FreshMvvm/issues/231
@EmilAlipiev How does that fix the issue of being able to set the text color?
I can't get it to work for the detail pages of the FreshMasterDetailNavigationContainer:
container.Master = FreshPageModelResolver.ResolvePageModel<MasterViewModel>();
container.Detail = new FreshNavigationContainer(homePage) {
BarTextColor = white,
BarBackgroundColor = primaryDarkBlue
};
However, if I switch it out with a regular FreshNavigationContainer, it works fine.
var page = FreshPageModelResolver.ResolvePageModel<Web01ViewModel>();
var container = new FreshNavigationContainer(page, SimpleNavigation) {
BarTextColor = white,
BarBackgroundColor = primaryDarkBlue
};
I had experience the same issue recently and I made something to solved. Add the next xaml code in your App.xaml:
<Style TargetType="NavigationPage"> <Setter Property="BarBackgroundColor" Value="White"/> <Setter Property="BarTextColor" Value="Black"/> </Style>