ecnepsnai
ecnepsnai

Reputation: 2026

Cannot get view to use entire screen width on iPhone 6+

In my storyboard I have a MapView that I would like to use the entire width of the screen. I created two constraints for the leading and the trailing space and they are set up as follows:

Constraints configuration

On the iPhone 4S - 6 the view works as expected, with the map using the entire screen width. But on the 6+ I can see that the map isn't using the entire width and has about 5px of padding on both sides, as seen here - it's hard to see with the background being white:

enter image description here

How can I make this mapview use the entire width of the screen for the 6+?

Upvotes: 2

Views: 117

Answers (1)

jrturton
jrturton

Reputation: 119292

Edit the constraints so that they're not using the margins (do this in the size inspector for each constraint, from the item drop down) then set the constants to 0. It looks like the margins are bigger on the 6 plus, so using -16 to offset isn't giving you the right effect.

Only use constraints relative to the margin if you actually want a margin. I've no idea why this is now the default, it's stupid.

Upvotes: 2

Related Questions