diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-12-07 20:20:17 -0500 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-12-07 20:22:25 -0500 |
commit | da65e881e2f7f90049a6d789faeaa45560801f26 (patch) | |
tree | 018d5950fc5d5b184b56025866476da11fedf565 | |
parent | 1ada238dfdf6042f8c1134f63cbe66b5d5921448 (diff) | |
download | qtlocation-mapboxgl-da65e881e2f7f90049a6d789faeaa45560801f26.tar.gz |
[ios] Fix the content insets for the scale and compass view.upstream/fabian-fix-content-insets
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 12 |
1 files 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]; |