Note that there are some explanatory texts on larger screens.

plurals
  1. POMake popover look the same in iOS 5.0 and iOS 5.1
    primarykey
    data
    text
    <p>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 :</p> <p><img src="https://i.stack.imgur.com/KA83r.png" alt="enter image description here"></p> <p>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.</p> <p>Edit: I've tried to use custom popoverBackgroundViewClass and (for positioning) present the popover manually:</p> <pre><code>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]; </code></pre> <p>but it worked only a little:</p> <p><img src="https://i.stack.imgur.com/8wcZ6.png" alt="popoverBackgroundViewClass solution"></p> <p>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). </p> <p>I've implemented the background class like this:</p> <pre><code>@interface EBPopoverBackgroundView : UIPopoverBackgroundView @end </code></pre> <p>and .m</p> <pre><code>@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 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload