Reputation: 1292
I've sorta got a little problem. I'm trying to add a popoverview to my app but part of the popoverview get's hidden by my navigation controller bar. How can I make my popoverview overlay over top of the navcontrollerbar? Here's an image of the problem: http://img593.imageshack.us/img593/4056/viewn.jpg
Here's my code I'm working with:
- (IBAction)onButtonClick:(UIButton *)button {
if (self.popoverController) {
[self.popoverController dismissPopoverAnimated:YES];
self.popoverController = nil;
[button setTitle:@"Show Popover" forState:UIControlStateNormal];
} else {
UIViewController *contentViewController = [[WEPopoverContentViewController alloc] initWithStyle:UITableViewStylePlain];
self.popoverController = [[[WEPopoverController alloc] initWithContentViewController:contentViewController] autorelease];
[self.popoverController presentPopoverFromRect:button.frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionDown
animated:YES];
[contentViewController release];
[button setTitle:@"Hide Popover" forState:UIControlStateNormal];
}
}
Is there anyway to make this popover above the navigation controller bar?
Hopefully someone knows how to fix this problem, Thanks in advance.
Upvotes: 6
Views: 4134
Reputation: 1142
ohh..I got it..I changed line in function
- (void)presentPopoverFromRect:(CGRect)rect
inView:(UIView *)theView
permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections
animated:(BOOL)animated {
in WEPopOverController
from [keyView addSubview:backgroundView];
to [theView addSubview:backgroundView];
Upvotes: 0
Reputation: 7103
Could this be related to the inView parameter to WEPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:
? Instead of presenting it in self.view
could you present further up in the view hierarchy (like in self.view.window
)?
Upvotes: 8