Martyn Chamberlin
Martyn Chamberlin

Reputation: 1278

Basics of autolayout in Xcode 6

Here's my question:

Without writing any code (i.e. using built-in auto sizing and constraints), here's my goal:

Have this UITextView's width be almost the width of the screen width, regardless of that screen's width. But have 20 pixels of padding on the left and right.

Help! Is this even possible? Surely it is???

Upvotes: 1

Views: 406

Answers (1)

Chris Wagner
Chris Wagner

Reputation: 21013

Add the 4 constraints shown in the screenshot.

enter image description here

You are pinning the textview to be 0 points from the top and bottom as well as 20 points from the left (leading) and right (trailing) space.

Upvotes: 1

Related Questions