2013-04-26 110 views
1

我點擊UITableViewCell加載ABPeoplePickerNavigationController禁用點擊背景UIViewController

self.peoplePicker = [[ABPeoplePickerNavigationController alloc] init]; 
self.peoplePicker.peoplePickerDelegate = self; 
[self.peoplePicker setDelegate:self]; 
self.peoplePicker.modalPresentationStyle = UIModalPresentationFormSheet; 
[self presentViewController:self.peoplePicker animated:YES completion:nil]; 

當選擇器是作爲UIModalPresentationFormSheet,我想禁用它背後的UIViewController。爲此,我可以加載一個透明視圖來呈現選取器,並在選取器解散時解除它。所以點擊viewcontroller不會工作。 我想知道是否有另一種方式來做到這一點,我不需要創建一個新的UIView並加載/解僱它。

+0

當您將視圖控制器作爲表單工作表時,默認情況下禁用它後面的視圖,即它顯示後面的灰色視圖。 – 2013-04-26 07:01:01

回答

1

您可以在呈現之前和關閉拾取器視圖之後,在ViewController視圖上顯示setUserInteractionEnabled屬性。