1
我有一個正在顯示自定義UIViewController的UIPopoverViewController。當我點擊一個按鈕,我有一個動作運行,因此我添加一個視圖到UIViewController的視圖的視圖層次結構。UIPopoverViewController添加子視圖很慢
問題是,它非常慢,需要幾秒鐘的時間才能顯示視圖。我沒有用我的UIViewController的代碼做任何不尋常的事情。
- (void)showAccountChooser {
self.twitterAccountPicker = [TwitterAccountPicker new];
[self.view addSubview:self.twitterAccountPicker.view];
self.twitterAccountPicker.view.frame = self.view.bounds;
self.twitterAccountPicker.view.transform = CGAffineTransformMakeScale(.05, .05);
[UIView animateWithDuration:0.5f animations:^{
self.twitterAccountPicker.view.transform = CGAffineTransformMakeScale(1, 1);
} completion:^(BOOL finished) {
//[self.twitterAccountPicker viewDidAppear:YES];
}];
}
是我添加的UIViewController中是微不足道的,並在viewDidLoad中或viewWill/DidAppear不重處理。我已經設置了斷點並確認它沒有做任何事情不好。
添加視圖時,其他人注意到這一點?