need help on Xamarin Forms IOS (Android works fine). When I open a new page on a tabbed project, the navbar on IOS appears INVISIBLE, but when scrolling the page up and down, the Navbar appears, although invisible, the back button is there and can be clicked. All other pages of the project have the same behavior, the back button is there, but invisible. See the image below. How to set for navbar visible for all pages?
see GIF here :
CodePudding user response:
This is default behavior change for iOS15, to solve the issue we just need to modify the scrollEdgeAppearance
property of UINavigationBarAppearance
.
Place the following code in AppDelegate.cs
or SceneDelegate.cs
in iOS project .
UINavigationBarAppearance a = new UINavigationBarAppearance();
a.ConfigureWithTransparentBackground();
a.BackgroundColor = UIColor.Blue;
a.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White};
UINavigationBar.Appearance.StandardAppearance = a;
UINavigationBar.Appearance.CompactAppearance = a;
UINavigationBar.Appearance.ScrollEdgeAppearance = a;
Refer to