我有一个UIViewController在出现In-Call状态栏时正确调整自身大小。另外,这提供了一个子UIViewController,它也可以正确调整自身的大小。但是,如果我呈现孩子VC并显示通话中状态栏,则在解除孩子后,父VC的大小不会像呼叫栏中显示的那样。如果我隐藏并重新显示状态栏,则父级将正确调整其大小。如何在解雇孩子时正确调整父VC的大小?
示例:
Parent.m
[self.view addSubview:self.webView];
self.webView.autoresizesSubviews = YES;
//The webview resizes correctly when in-call status bar shows
self.childViewController = [[Child alloc]init];
//present child
[self presentViewController:self.childViewController animated:YES completion:nil];
//In-call status bar shows (child resizes correctly)
[self.childViewController dismissViewControllerAnimated:YES completion:nil];
//View is still sized as if in-call status bar is not shown
Child.m
self.view.autoresizesSubviews = YES;
[self.view setAutoresizingMask:(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth)];
//The view resizes correctly when in-call status bar shows
答案 0 :(得分:0)
不幸的是我无法解决这个问题。相反,我从呈现和解除子视图控制器切换到推送和弹出它作为导航项。我注意到的唯一真正的区别是动画是不同的(孩子从右边而不是从底部动画),但除此之外它看起来实际上是相同的,并且调用状态栏的问题解决了自己。