Doug Smith
Doug Smith

Reputation: 29316

With AutoLayout, I want an 8px high view to stick to the bottom of its superview

I have a UIView acting as a progress bar that sites at the bottom of the screen. I can't seem to figure out how to use AutoLayout to have it stick to the bottom of the screen and remain 8px high.

Is it possible to do this in Interface Builder?

Upvotes: 1

Views: 2333

Answers (1)

Tim
Tim

Reputation: 60110

You want to:

  • Pin the height of the view to 8 points
  • Pin the space between the view and its superview along the bottom

You can do both of these things in Interface Builder - look at the context menus in the bottom right of the design pane. If the metrics aren't quite right after you've pinned the things you want, you can select the constraints that IB will create and adjust their constants directly.

Upvotes: 3

Related Questions