when starting an iPad Master-Detail Application in xcode 4.6, in portrait orientation, there is a dismissible menu (in landscape it is always on). This menu (is popover right name?) looks quite different in iOS 5.0 and iOS 5.1, see below :
Is there a way to make the popover look in 5.0 the same as in 5.1 (and later)? Eg. it takes whole height of the screen, has no extra borders/arrows etc. Desired behavior is highlighted with green, iOS5.0 in red.
Edit: I've tried to use custom popoverBackgroundViewClass and (for positioning) present the popover manually:
self.masterPopoverController.popoverBackgroundViewClass = [EBPopoverBackgroundView class];
[self.masterPopoverController setPopoverContentSize:CGSizeMake(320, 1004)];
[self.masterPopoverController presentPopoverFromRect:CGRectMake(-20, -40, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
but it worked only a little:
There is spece to the left and bottom of the popover which I'm unable to remove (I've tried extra large popover, yet the bottom space did not go away. I've tried to move it even more to the left, yet the left space did not go away). In addition, the navigation bar is too thin (about 10px thinner) and I was not able to change that either (even though I did not try that hard on this last bit). Last but not least there is a 1px black line to the right of the popover (even though I set insets to 0).
I've implemented the background class like this:
@interface EBPopoverBackgroundView : UIPopoverBackgroundView
@end
and .m
@implementation EBPopoverBackgroundView {
}
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
NSLog(@"Init with frame %@", NSStringFromCGRect(frame));
}
return self;
}
- (CGFloat)arrowOffset {
return 0.0;
}
- (void)setArrowOffset:(CGFloat)arrowOffset {
// pass
}
- (UIPopoverArrowDirection)arrowDirection {
return UIPopoverArrowDirectionRight;
}
- (void)setArrowDirection:(UIPopoverArrowDirection)arrowDirection {
// pass
}
+ (CGFloat)arrowHeight {
return 1.0;
}
+ (CGFloat)arrowBase {
return 1.0;
}
+ (UIEdgeInsets)contentViewInsets {
return UIEdgeInsetsMake(0, 0, 0, 0);
}
- (void)drawRect:(CGRect)rect {
NSLog(@"DrawRect %@", NSStringFromCGRect(rect));
[super drawRect:rect];
}
+ (BOOL)wantsDefaultContentAppearance {
return YES;
}
@end
As far as my research went, there is NO WAY to do this except to implement the popover as a brand new component from scratch.