Note that there are some explanatory texts on larger screens.

plurals
  1. POHelp with UIPopOverController size
    primarykey
    data
    text
    <p>So I have a <code>view</code> with a bunch of button in a <code>UIScrollView</code>. When the user presses a button, I want a UIPopOverController to display pointing at the selected button. It kind of works, but the popover is the wrong size and points to a random point in the view. Here is my code. Thanks in advance.</p> <pre><code>-(void)detail:(id)sender{ UIButton *button = sender; NSLog(@"tag = %i", button.tag); UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { self.popover = [[UIPopoverController alloc] initWithContentViewController:navController]; self.popover.delegate = self; [self.popover presentPopoverFromRect:button.bounds inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } </code></pre> <p>Than the problem with the size of the popover: In the view that is inside the popover, I have:</p> <pre><code>self.contentSizeForViewInPopover = scroll.contentSize; NSLog(@"%f, %f", scroll.contentSize.height, scroll.contentSize.width); NSLog(@"showing: %f, %f", self.contentSizeForViewInPopover.height, self.contentSizeForViewInPopover.width); </code></pre> <p>and both logs are matching. So I think everything should work correctly. But it doesn't. Here is a screen shot. Let me know if you need more of my code. Thanks in advance.</p> <p><img src="https://i.stack.imgur.com/GRfkv.png" alt="screen shot of the error"></p>
    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