/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//declare this in the .h file InfoPopoverController *popoverContent; UIPopoverController *popover; -(IBAction) infoButtonClicked:(id)sender{ popoverContent=[[InfoPopoverController alloc] initWithNibName:@"InfoPopoverController" bundle:nil]; popover = [[UIPopoverController alloc] initWithContentViewController:popoverContent]; [popover setDelegate:self]; [popover setPopoverContentSize:CGSizeMake(989,545)]; popoverContent.contentSizeForViewInPopover=popoverContent.view.bounds.size; [popover presentPopoverFromRect:((UIView *)sender).frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; } - (void)popoverControllerDidDismissPopover:(UIPopoverController*)popoverController{ if (popover) { [popover dismissPopoverAnimated:YES]; [popover release]; popover=nil; if (popoverContent != nil) { [popoverContent release]; popoverContent = nil; } } } -(void)killPopoversOnSight { if (popover) { [popover dismissPopoverAnimated:NO]; } }