iOS status bar api implement
This commit is contained in:
@@ -7,11 +7,12 @@
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "NavigationController.h"
|
||||
#import "ViewController.h"
|
||||
|
||||
@interface AppDelegate ()
|
||||
@property(nonatomic, strong) UIViewController *rootVC;
|
||||
@property(nonatomic, strong) UINavigationController *navigationController;
|
||||
@property(nonatomic, strong) NavigationController *navigationController;
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
@@ -22,9 +23,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.rootVC = [[ViewController alloc] init];
|
||||
|
||||
self.window.rootViewController = self.rootVC;
|
||||
self.navigationController = [[UINavigationController
|
||||
self.navigationController = [[NavigationController
|
||||
alloc] initWithRootViewController:self.rootVC];
|
||||
self.window.rootViewController = self.navigationController;
|
||||
[self.window addSubview:self.navigationController.view];
|
||||
[self.window makeKeyAndVisible];
|
||||
return YES;
|
||||
|
@@ -50,5 +50,7 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
28
doric-iOS/Example/Example/NavigationController.h
Normal file
28
doric-iOS/Example/Example/NavigationController.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright [2019] [Doric.Pub]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
//
|
||||
// NavigationController.h
|
||||
// Doric
|
||||
//
|
||||
// Created by jingpeng.wang on 2020/1/14.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface NavigationController : UINavigationController
|
||||
|
||||
@end
|
||||
|
33
doric-iOS/Example/Example/NavigationController.m
Normal file
33
doric-iOS/Example/Example/NavigationController.m
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright [2019] [Doric.Pub]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
//
|
||||
// NavigationController.m
|
||||
// Doric
|
||||
//
|
||||
// Created by jingpeng.wang on 2020/1/14.
|
||||
//
|
||||
#import "NavigationController.h"
|
||||
|
||||
@implementation NavigationController
|
||||
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle {
|
||||
return [self.topViewController preferredStatusBarStyle];
|
||||
}
|
||||
|
||||
- (BOOL)prefersStatusBarHidden {
|
||||
return [self.topViewController prefersStatusBarHidden];
|
||||
}
|
||||
@end
|
@@ -6,9 +6,9 @@
|
||||
// Copyright © 2019 pengfei.zhou. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ViewController.h"
|
||||
#import <DoricCore/Doric.h>
|
||||
#import "DemoVC.h"
|
||||
|
||||
#import "ViewController.h"
|
||||
#import "QRScanViewController.h"
|
||||
#import "DemoLibrary.h"
|
||||
|
||||
|
Reference in New Issue
Block a user