Cayoda
Cayoda

Reputation: 189

ios Auto-Layout UIView on 3.5 changing height on 4.0 inch

I Have an UIView in a ViewController placed at the bottom of a 3.5 Inch Layout.

In a 4.0 Inch Layout, the UIView change its Height(im Using Auto-layout -> reset to Suggested Constraints in myViewController) but i dont want change the height. I Need only to change the Y coordinate to place the View At the Bottom again in 4.0

Any Suggestions?

Layout on 3.5 Inch(and the position what i want the bottomBar without any resizing) http://postimg.org/image/pxbqz770h/

Layout on 4.0 Inch http://postimg.org/image/v419qxr37/

Upvotes: 0

Views: 290

Answers (2)

Maria
Maria

Reputation: 4611

Use constraints, this will shrink or grow the view depending on the device. On Interface builder, click on your UI object, then click on the constraint pin tool. Insert a constraint for the top and the bottom. Take a look at this link

https://developer.apple.com/library/ios/recipes/xcode_help-interface_builder/articles-autolayout/pin-constraints.html

Upvotes: 0

timothykc
timothykc

Reputation: 2235

To elaborate on Douglas's comment, you want to set your own constraints manually. Suggested constraints are often handy, but not always 100% correct.

Among the key-constraints you'll want are the "view to bottom" and the height constraint"

On storyboard, there's a "pin" button. Click that, and you can set the necessary constraints here.

Upvotes: 2

Related Questions