【发布时间】:2020-08-18 11:46:12
【问题描述】:
我有一个新的自定义 UIWindow 来显示仅支持的 fullSrceen ViewController
UIInterfaceOrientationMaskLandscapeLeft
- (BOOL)shouldAutorotate {
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationLandscapeLeft;
}
一个按钮点击它打开“set window.hidden = NO”
- (void)show {
UIWindowScene *scence = [UIApplicationsharedApplication].connectedScenes.allObjects.firstObject;
self.window = [[CustomWindow alloc]initWithWindowScene:scence];
CustomViewController *vc = [[CustomViewController alloc]init];;
self.window.rootViewController = vc;
self.window.hidden = NO;
self.window.windowLevel = 2;
[self.window makeKeyAndVisible];
}
和一个按钮来关闭“set window.hidden = YES”,
- (void)close {
self.window.hidden = YES;
self.window = nil;
}
一切正常,但是当我打开窗口并回到后台,然后我进入前台并关闭窗口时,navigationbar 不在位置。
【问题讨论】:
-
为什么要创建一个新帐户和问题而不是编辑和修复your previous one?
标签: ios objective-c swift uinavigationcontroller