views:

187

answers:

1

hi all! I'm drawing a popover after a button clicked and I wish view into the popover a grid with a square thumb of an image and some text....

thanks!

+1  A: 

Hi,

If I understand your question right, you want to have a custom view in your UIPopovercontroller. This can be done by creating a new UIViewController, with its own content.

Then load you popovercontroller from the class you load the action from. Example:

myView *theView = [[myView alloc] initWithNibName:@"myView" 
                                           bundle:nil];

UIPopoverController* aPopover = [[UIPopoverController alloc] initWithContentViewController:theView];
[aPopover setDelegate:self];
[aPopover setPopoverContentSize:CGSizeMake(320, 320) animated:YES];

[theView setPopover:aPopover];
[theView release];

[self.popoverController presentPopoverFromRect:CGRectMake(510,370,0,0) inView:self.view  permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

I hope this helped!

Best regards, Paul Peelen

Paul Peelen
thanks paul, but How can I add an image near the text?
ghiboz