iOS:Compat with iOS 15
This commit is contained in:
parent
63e0d1c38c
commit
ea4f6a4f08
@ -25,6 +25,12 @@ - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session op
|
||||
doricViewController.navigationItem.rightBarButtonItem = rightBarItem;
|
||||
#endif
|
||||
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:doricViewController];
|
||||
UINavigationBar *bar = navigationController.navigationBar;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
UINavigationBarAppearance *barAppearance = [UINavigationBarAppearance new];
|
||||
barAppearance.backgroundColor = UIColor.whiteColor;
|
||||
bar.scrollEdgeAppearance = bar.standardAppearance = barAppearance;
|
||||
}
|
||||
UIWindow *window = [[UIWindow alloc] initWithWindowScene:windowScene];
|
||||
window.frame = windowScene.coordinateSpace.bounds;
|
||||
window.rootViewController = navigationController;
|
||||
|
@ -23,6 +23,12 @@ - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session op
|
||||
doricViewController.navigationItem.rightBarButtonItem = rightBarItem;
|
||||
#endif
|
||||
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:doricViewController];
|
||||
UINavigationBar *bar = navigationController.navigationBar;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
UINavigationBarAppearance *barAppearance = [UINavigationBarAppearance new];
|
||||
barAppearance.backgroundColor = UIColor.whiteColor;
|
||||
bar.scrollEdgeAppearance = bar.standardAppearance = barAppearance;
|
||||
}
|
||||
UIWindow *window = [[UIWindow alloc] initWithWindowScene:windowScene];
|
||||
window.frame = windowScene.coordinateSpace.bounds;
|
||||
window.rootViewController = navigationController;
|
||||
|
@ -47,6 +47,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
|
||||
#if __has_include(<SDWebImage/SDWebImage.h>)
|
||||
[SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder];
|
||||
#endif
|
||||
UINavigationBar *bar = self.navigationController.navigationBar;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
UINavigationBarAppearance *barAppearance = [UINavigationBarAppearance new];
|
||||
barAppearance.backgroundColor = UIColor.whiteColor;
|
||||
bar.scrollEdgeAppearance = bar.standardAppearance = barAppearance;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user