Skip to content

Commit

Permalink
Merge pull request #4875 from wlixcc/master
Browse files Browse the repository at this point in the history
Fix navigation bar transparent issue
  • Loading branch information
pmairoldi committed Aug 27, 2022
2 parents 5f6edd8 + 65c93d4 commit 79cfb9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ChartsDemo-iOS/Objective-C/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

DemoListViewController *vc = [[DemoListViewController alloc] init];
UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
if (@available(iOS 13.0, *)) {
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearance configureWithOpaqueBackground];
nvc.navigationBar.standardAppearance = appearance;
nvc.navigationBar.scrollEdgeAppearance = appearance;
}

_window.rootViewController = nvc;
[_window makeKeyAndVisible];
Expand Down
6 changes: 6 additions & 0 deletions ChartsDemo-iOS/Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

let vc = DemoListViewController()
let nav = UINavigationController(rootViewController: vc)
if #available(iOS 13.0, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
nav.navigationBar.standardAppearance = appearance
nav.navigationBar.scrollEdgeAppearance = appearance
}

window?.rootViewController = nav
window?.makeKeyAndVisible()
Expand Down

0 comments on commit 79cfb9a

Please sign in to comment.