这是场景。
在启动我的应用程序之前,我打了一个电话。然后我打开我的应用程序,由于来电通知,状态栏高度增加了一倍。正因为如此,我的应用程序的整个 UI 被额外下推了 20pt。切换回电话应用程序并结束通话,当我再次打开我的应用程序时,UI 和刚才一样卡住,只是绿色通知栏不见了,顶部多了一个 20pt 的黑色条。
如果在我拨打电话之前我的应用程序已经启动,则不会发生这种情况。
我用过[self.window makeKeyAndVisible];
知道在这种情况下如何正确调整 UI 吗?
更新:
这是代码
ADTransitionController *transitionController= [[ADTransitionController alloc] initWithRootViewController:[[MainViewController alloc] init]];
transitionController.wantsFullScreenLayout = YES;
ConfigurationSetupViewController *menuController = [[ConfigurationSetupViewController alloc] init];
REFrostedViewController *frostedViewController = [[REFrostedViewController alloc] initWithContentViewController:transitionController menuViewController:menuController];
frostedViewController.direction = REFrostedViewControllerDirectionLeft;
frostedViewController.liveBlurBackgroundStyle = REFrostedViewControllerLiveBackgroundStyleLight;
if ([GBDeviceInfo deviceDetails].majoriOSVersion < 7) {
frostedViewController.blurRadius = 2;
}
self.window.rootViewController = frostedViewController;
我已经深入研究了 REFrostedViewController 的问题。如果我将 rootViewController 设置为 transitionController,则布局完美对齐。
Update2: 所以事实是..当存在双状态栏时,ADTransitionController 将设置 coordY = 20 和 height = 548. REFrostedViewController 做同样的事情.. 导致我顶部有 40 个边距.. 一件事我不确定是.. 什么时候设置这些 UIViews 的框架?