开发者

displaying a ABPeoplePickerNavigationController inside a UIPopover

开发者 https://www.devze.com 2023-03-16 04:05 出处:网络
I have a UIPopover that has a navigationController stack. From the second view in that stack, I want to display an ABPeoplePickerNavigationController modally in the popover. I have this working, but w

I have a UIPopover that has a navigationController stack. From the second view in that stack, I want to display an ABPeoplePickerNavigationController modally in the popover. I have this working, but when I dismiss the modalViewController, the original navigation controller for the UIPoover is missing from the popover. Is there a way to make this work properly? Code below:




   (IBAction)showPicker:(id)sender {
       ABPeoplePickerNavigationController *picker =
          [[ABPeoplePickerNavigationCo开发者_JS百科ntroller alloc] init];
        picker.peoplePickerDelegate = self;

       picker.modalPresentationStyle = UIModalPresentationCurrentContext;
       picker.modalInPopover = YES;
       [self presentModalViewController:picker animated:YES];  
       // self is the 2nd viewController in the original navigation stack
       [picker release];
    }

    (void)peoplePickerNavigationControllerDidCancel:
       (ABPeoplePickerNavigationController *)peoplePicker {
            [self dismissModalViewControllerAnimated:YES];
     }


Problem solved as below:

[self.navigationController presentModalViewController:picker animated:YES];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号