Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change autoresizing for particular controller from Interface Builder?

I found some of my view controllers have

<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>

in my storyboard source code. This was causing problem as I figured out later. It has to be

<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

But I couldn't find how to change it from Interface Builder. Anybody knows which element in IB represents autoresizingMask tag?

like image 791
Pablo Avatar asked Jan 29 '26 19:01

Pablo


1 Answers

From Interface Builder, go to your storyboard and select the most outer view (from the Document Outline) of your ViewController and then go to the Size Inspector (ruler icon) and you can find those autoresizingMask attributes of the xml as Autoresizing in your Interface Builder.

widhtSizable (horizontal arrow) and heightSizable (vertical arrow) are the most inner arrows.

  • If the arrow is selected it is a fine line and that means that the value for that will be YES in your XML file.
  • In case the arrow is not selected (you can unselect it by clicking on it) it will be shown more transparent and with dotted line, that means that the value for that will be NO in your XML file.

Check this screenshot, although those lines will always be shown red I made them with different colors in the screenshot to let you better see that the horizontal one is width and the vertical one is height.

enter image description here

Same applies to the outer most lines shown as I or |-| and those applies to the y and x constraint that can be adjusted by autolayout automatically. You can select them or not depending on what is customisable by you or not.

like image 93
denis_lor Avatar answered Jan 31 '26 11:01

denis_lor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!