Layout and Popovers
Layout and Popovers
- Subject: Layout and Popovers
- From: Rick Aurbach <email@hidden>
- Date: Thu, 20 Oct 2016 15:19:08 -0400
- Acceptlanguage: en-US
- Thread-topic: Layout and Popovers
I’m sure I’m missing something really basic here, but I’ve been trying to figure this out for several days without success:
I have a sequence of panels that I am displaying in a UIPopoverPresentationController. I am implementing this using a UINavigationController with a stack of panels.
The panel that is causing a problem is a UITableViewController. The problem is that the controller’s tableView retains the default height that the UINavigationController has (1024 in my case), rather than the height of the visible rectangle of the UIPopoverPresentationController. In other words, the presentation controller is acting like a clipping window through which the (unmodified) tableView is displayed.
This is a problem because tableView.scrollToRow(at: indexPath, at: .middle, animated: true) places the specified row at the middle of what it thinks is the tableView (i.e., around 512 in my case), rather than in the center of the revealed rectangle defined by the popup presentation controller. In this case, this means the the scrolled row is not visible.
Note that I am using a storyboard, specifying Content Size: Use Preferred Explicit Size.
What should I do to fix this problem? Must I explicitly resize the UITableView to fit the popover’s view? Is there any way to get the autoLayout system to do this for me? Has anyone else experienced a similar problem?
Or am I just stupidly overlooking a completely obvious step that I really OUGHT to know?
Cheers,
Rick Aurbach
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden