I use the UIPopoverController and populate it with the MPMediaPickerController to select songs from the iPod library. Everything works fine for me. However, I added a completely unrelated function (touch the button and the image scale to a large size), and now the UIPopoverController behaves strangely only after using the new function.
After using the button zoom function, the UIPopoverController appears in a strange way. It appears to be animated from a turn from the screen and lands in the right place, but the expected behavior is that it should just appear in the right place.
// code for if the interface is a an iPhone, do not use popup if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) [self presentModalViewController:picker animated:YES];
// code if iPhone does not use popover media picker
else { UIPopoverController* pop = [[UIPopoverController alloc] initWithContentViewController:picker]; self.currentPop = pop;
// checks if the iPad is portrait or landscape, and displays the popover media collector accordingly
if (vertMode == TRUE) {
// if in portrait mode
[pop presentPopoverFromRect:CGRectMake(668.0f, 846.0f, 10.0f, 10.0f) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:NO];
// otherwise, if in landscape mode
} else if (vertMode == FALSE) { [pop presentPopoverFromRect:CGRectMake(900.0f, 580.0f, 10.0f, 10.0f) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:NO]; } [pop release]; }
}
source share