FreshMvvm icon indicating copy to clipboard operation
FreshMvvm copied to clipboard

Not Able to change the menu icon color and bar background color.

Open Shivaprabhu049 opened this issue 6 years ago • 4 comments

Hi, Im Not able to change the Menu icon color of FreshMasterDetailNavigationContainer and also the bar background color of detailed pages.

Shivaprabhu049 avatar Jun 05 '18 12:06 Shivaprabhu049

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 });

MauryZ avatar Jun 10 '18 10:06 MauryZ

see my answer here. https://github.com/rid00z/FreshMvvm/issues/231

EmilAlipiev avatar Jul 30 '18 22:07 EmilAlipiev

@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
            };

hauteur avatar Aug 24 '18 21:08 hauteur

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>

image

Cacata avatar Sep 18 '21 17:09 Cacata