Xcode 5 Autolayout and UIView Width Equals Height

I use autorun. I have a UIImageView in IB. I want to make its width equal to its height.

I learned how to do most of this stuff in Xcode 4. I know how to do this programmatically, but it causes errors and errors that Apple has not yet fixed:

'Auto Layout still required after executing -layoutSubviews. UITableViewCell implementation of -layoutSubviews needs to call super.'

So, how do I set this restriction in Xcode 5 Interface Builder?

+4
source share
4 answers

As Timothy Moose noted, you have the option of maintaining aspect ratio in Xcode 5.1.

Make sure the width and height are the same. Add an aspect ratio constraint using drag and drop on the control.

enter image description here

It will automatically maintain the height and width.

+8

Builder , ( / , ).

, , , .

+3

Interface Builder. , , , Apple, , .

+1

, , .

: ?

0

All Articles