[ios] Fix the content insets for the scale and compass view.

This commit is contained in:
Fabian Guerra
2017-12-07 20:20:17 -05:00
committed by Fabian Guerra Soto
parent 4525ff714a
commit d650b91c00

View File

@@ -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];