-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix problems with map view UI layout constraints #6776
Conversation
@friedbunny, thanks for your PR! By analyzing the history of the files in this pull request, we identified @1ec5, @frederoni and @incanus to be potential reviewers. |
Assumed the Swift equivalent would be something like |
As a private method, I think it’s not exposed in Swift (which is what lldb expects when you’re in a Swift app). Looks like |
NSLayoutRelationGreaterThanOrEqual meant that it either greater-than or equal could satisify the constraint, when really all we need is equal.
In iOS 10, the top layout guide is not always returning the expected value unless there is a constraint applied directly against it.
15eb4ed
to
33fd3ee
Compare
If you're using a map view that is not full size, you should set The following cases has been tested in iOS 8, 9 and 10:
|
Sorry if I'm being thick, but I'm having the same problem when resizing the map view to show an info panel with a POI's details. Where exactly should I set automaticallyAdjustsScrollViewInsets:NO? I'm not using auto layout, and all my views are created programatically. thanks |
|
@frederoni, just to be clear, though, we haven’t regressed #1327, have we? The compass should never float outside of the map view, even if you have a non-full-screen map view and |
I reopened #6954 to track the regression exacerbated by this PR. |
This addresses two problems with the map view’s UI elements (compass, attribution button, logo):
Fixes ambiguous constraints
Fixes #5549.
By declaring that the vertical constraint relationships were
NSLayoutRelationGreaterThanOrEqual
, this meant that there were many positions that could potentially satisfy these constraints. This is not what we want (and not what was being shown) — the vertical placement of these views should beNSLayoutRelationEqual
to the exact values we calculate.Fixes iOS 10 giving us incorrect
topLayoutGuide
valuesFixes #6755, where the vertical offset of the compass would be incorrect after device rotation.
Compared to iOS 9, iOS 10 is giving incorrect values for
topLayoutGuide
when the device is rotated. For reasons I don’t understand, re-adding a direct constraint againsttopLayoutGuide
fixes the issue. This walks back a small part of #5671, where our accounting for layout guides moved entirely to-adjustContentInset
.This fix isn’t great, but it’s backwards compatible and it works.
Notes
po [[UIWindow keyWindow] _autolayoutTrace]
is great./cc @frederoni @1ec5