2011-11-02 63 views
0

我想使用presentModalViewController來顯示ABPeoplePickerNavigationController。 但模態控制器出現在簡單的UIInterfaceOrientationPortrait中,而不是顛倒。所以用戶必須旋轉iPhone才能選擇聯繫人。presentModalViewController in UIInterfaceOrientationPortraitUpsideDown

是否可以在UIInterfaceOrientationPortraitUpsideDown中呈現模態視圖控制器?

回答

2

最後,我必須繼承ABPeoplePickerNavigationController。 在我的派生類中重寫我只

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

只爲UIInterfaceOrientationPortraitUpsideDown返回YES。

,並提出它之前設置

picker.modalPresentationStyle = UIModalPresentationCurrentContext;