Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with presentPopoverFromRect and setPopoverContentSize in iOS7
    primarykey
    data
    text
    <p>To get popovers in iOS7 to function properly it appears I have to make some workarounds, in the code below I'm trying to understand why redisplaying the popover the second time is necessary. Without the redisplay when in iOS7 the arrows point to the wrong place if they are turned on. Normally the app runs in landscape so I'm wondering if that has to do with orientation and timing of the animations. Also without the redisplay a transparent pane zooms out in about 500ms to fill the screen just before the popover slides into place. With the redisplay then the popover just snaps into the right place, as expected.</p> <pre><code>NSArray *currSysVer= [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."]; if(self.showingKeyboard == NO) { if([[currSysVer objectAtIndex:0] intValue] &gt; 6) { [selectPopover presentPopoverFromRect:localField.frame inView:localField permittedArrowDirections:NO animated:NO]; } else { [selectPopover presentPopoverFromRect:localField.frame inView:localField permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } } //Determine height and width of popover to fit all values CGFloat width = 320; if(multiSelect) { width = 450; } for(NSString *value in values) { CGSize size = [value sizeWithFont:[UIFont systemFontOfSize:23]]; if(size.width &gt; width) { width = size.width; } } CGFloat height = (44 * [values count] + 1) &gt; 800 ? 800 : 44 * [values count] + 1; if([[currSysVer objectAtIndex:0] intValue] &gt; 6) { height += 6; } [selectPopover setPopoverContentSize:CGSizeMake(width, height + 36) animated:NO]; if(self.showingKeyboard == NO &amp;&amp; [[currSysVer objectAtIndex:0] intValue] &gt; 6) { [selectPopover presentPopoverFromRect:localField.frame inView:localField permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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