I have this code:
if([self.popoverController isPopoverVisible])
{
[self.popoverController dismissPopoverAnimated:YES];
return;
}
UIViewController* popoverContent = [[UIViewController alloc]init];
popoverContent.view = tableView1.view;
self.popoverController = [[UIPopoverControlle开发者_运维百科r alloc]
initWithContentViewController:popoverContent];
[self.popoverController presentPopoverFromRect:CGRectMake(1200, 280, 50, 50) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:TRUE];
[[[popoverController contentViewController] view] setAlpha:1]; //alpha del contenuto del popover
[popoverContent release];
It work fine, but I'm not able to place the popover in the lower right, I try to change values in [self.popoverController presentPopoverFromRect:CGRectMake(1200, 550, 100, 100) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:TRUE];
but I want this popover small in lower right...how can I do?
I solved in this way:
[popoverController setPopoverContentSize:CGSizeMake(320.0f, 262.0f)];
[self.popoverController presentPopoverFromBarButtonItem:barButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
精彩评论