0

使用此代码;iPad UIPopover 出现在屏幕顶部,而不是在按下它的按钮上方 - 我知道 Apple 为此拒绝应用程序,所以有没有办法让它出现在按下的按钮上方?这是当前调用它的代码;

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
       self.popover = [[UIPopoverController alloc] initWithContentViewController:(UIViewController *)picker];
        CGRect takePhotoRect;
        takePhotoRect.origin = self.view.frame.origin;
        takePhotoRect.size.width = 1;
        takePhotoRect.size.height = 1;
        [self.popover setPopoverContentSize:CGSizeMake(320.0, 216.0)];

        [self.popover presentPopoverFromRect:takePhotoRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
4

1 回答 1

0

在你的

[self.popover presentPopoverFromRect:takePhotoRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

方法,使用按钮的框架,例如:

[self.popover presentPopoverFromRect:myButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
于 2013-09-16T11:48:43.647 回答