0
我有一個UIViewController,正確調整自己當調用狀態欄出現時自己。此外,這提出了一個孩子UIViewController它也正確調整自己。但是,如果我介紹孩子VC並顯示通話狀態欄,在解僱孩子後,父VC不會像通話欄中顯示的那樣大小。如果我隱藏並重新顯示狀態欄,則父級將正確調整其自身。我如何做到這一點,所以在解僱孩子時父母VC的大小已經正確。在調用狀態欄不會導致父UIViewController調整大小
例子:
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
問題評論:添加演示此問題的代碼的簡化版本。 –
@RichLinnell補充說。謝謝! – Cowabunghole