iOS status bar api implement

This commit is contained in:
王劲鹏
2020-01-14 11:00:22 +08:00
committed by osborn
parent c63454869c
commit 73c06373ad
11 changed files with 184 additions and 7 deletions

View File

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

View File

@@ -50,5 +50,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>

View 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

View 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

View File

@@ -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"