Gasim
Gasim

Reputation: 7991

Use auto layout to have width of any view to be equal to the screen width

How can I make a view to have the width of the screen view. In Xcode 6 the default "Inferred" simulated metrics for the size is 600x600. When I add the constraints for the view to have the width of the view to be equal to the width of the parent, it keeps the size 600px because I am guessing that it takes the size of the simulated metrics....

How can I have the width to be equal to the screen width? Using "Width Equal" is obviously not an option here. So, what should I do?

Thank you!

Upvotes: 0

Views: 512

Answers (1)

H K
H K

Reputation: 1275

Remove any other constraints associated with width and set the leading & trailing to 0.

Upvotes: 1

Related Questions