From da65e881e2f7f90049a6d789faeaa45560801f26 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Thu, 7 Dec 2017 20:20:17 -0500 Subject: [ios] Fix the content insets for the scale and compass view. --- platform/ios/src/MGLMapView.mm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 60c2e0dd09..6215d4b7c9 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -885,8 +885,10 @@ public: // compass view [self removeConstraints:self.compassViewConstraints]; [self.compassViewConstraints removeAllObjects]; - [self.compassViewConstraints addObject:[self.compassView.topAnchor constraintEqualToAnchor:safeAreaLayoutGuide.topAnchor - constant:5.0 + self.contentInset.top]]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + [self.compassViewConstraints addObject:[self.compassView.topAnchor constraintEqualToSystemSpacingBelowAnchor:safeAreaLayoutGuide.topAnchor multiplier:1]]; +#pragma clang diagnostic pop [self.compassViewConstraints addObject:[safeAreaLayoutGuide.rightAnchor constraintEqualToAnchor:self.compassView.rightAnchor constant:8.0 + self.contentInset.right]]; [self addConstraints:self.compassViewConstraints]; @@ -894,8 +896,10 @@ public: // scale bar view [self removeConstraints:self.scaleBarConstraints]; [self.scaleBarConstraints removeAllObjects]; - [self.scaleBarConstraints addObject:[self.scaleBar.topAnchor constraintEqualToAnchor:safeAreaLayoutGuide.topAnchor - constant:5.0 + self.contentInset.top]]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + [self.scaleBarConstraints addObject:[self.scaleBar.topAnchor constraintEqualToSystemSpacingBelowAnchor:safeAreaLayoutGuide.topAnchor multiplier:1]]; +#pragma clang diagnostic pop [self.scaleBarConstraints addObject:[self.scaleBar.leftAnchor constraintEqualToAnchor:safeAreaLayoutGuide.leftAnchor constant:8.0 + self.contentInset.left]]; [self addConstraints:self.scaleBarConstraints]; -- cgit v1.2.1