Skip to content

Commit

Permalink
fix:在iOS9.0系统中直接不显示状态栏的问题,但是在开启cpu监听等状态时,还是不显示状态栏,暂未找到解决版本
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwei8090 committed Feb 22, 2019
1 parent 533cce8 commit a209d8b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 3 deletions.
16 changes: 16 additions & 0 deletions iOS/DoraemonKit/Src/Core/Base/DoraemonStatusBarViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// DoraemonStatusBarViewController.h
// AFNetworking
//
// Created by 张伟 on 2019/2/22.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface DoraemonStatusBarViewController : UIViewController

@end

NS_ASSUME_NONNULL_END
38 changes: 38 additions & 0 deletions iOS/DoraemonKit/Src/Core/Base/DoraemonStatusBarViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// DoraemonStatusBarViewController.m
// AFNetworking
//
// Created by 张伟 on 2019/2/22.
//

#import "DoraemonStatusBarViewController.h"

@interface DoraemonStatusBarViewController ()

@end

@implementation DoraemonStatusBarViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (BOOL)prefersStatusBarHidden
{
return NO;
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleDefault;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/

@end
13 changes: 10 additions & 3 deletions iOS/DoraemonKit/Src/Core/Entry/DoraemonEntryView.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#import "UIImage+Doraemon.h"
#import "DoraemonDefine.h"
#import "DoraemonHomeWindow.h"

#import "DoraemonStatusBarViewController.h"
@interface DoraemonEntryView()

@property (nonatomic, assign) BOOL isOpen;
Expand All @@ -32,8 +32,15 @@ - (instancetype)init{

self.backgroundColor = [UIColor clearColor];
self.windowLevel = UIWindowLevelStatusBar + 100.f;
if (!self.rootViewController) {
self.rootViewController = [[UIViewController alloc] init];
NSString *version= [UIDevice currentDevice].systemVersion;
if(version.doubleValue >=10.0) {
if (!self.rootViewController) {
self.rootViewController = [[UIViewController alloc] init];
}
}else{
if (!self.rootViewController) {
self.rootViewController = [[DoraemonStatusBarViewController alloc] init];
}
}

UIButton *entryBtn = [[UIButton alloc] initWithFrame:self.bounds];
Expand Down

0 comments on commit a209d8b

Please sign in to comment.