2016-08-10 44 views
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 
+0

問題評論:添加演示此問題的代碼的簡化版本。 –

+0

@RichLinnell補充說。謝謝! – Cowabunghole

回答

0

不幸的是我無法來解決這個問題。相反,我從呈現和解散子視圖控制器切換爲推送並將其作爲導航項目彈出。我注意到唯一真正的區別是動畫是不同的(孩子從右而不是從底部開始動畫),但除此之外它似乎實際上是相同的,並且通話狀態欄的問題自行解決。

相關問題