SetAutoresizingMask from code in osx

There is a section in the size inspector called Atosizing that can set the left, right, top layout of the control, I believe that I do this with setAutoresizingMask , but I don’t know how to set it so that my control layout is up and right (means when the user resizes the window, my steak controls right and up)

+3
objective-c xcode cocoa autoresizingmask
source share
1 answer

Take a look at these -setAutoresizingMask options:

NSViewNotSizable

The receiver cannot be changed.

NSViewMinXMargin

The left margin between the receiver and its surveillance is flexible.

NSViewWidthSizable

The width of the receivers is flexible.

NSViewMaxXMargin

The correct margin between the receiver and its add-in is flexible.

NSViewMinYMargin

The bottom margin between the receiver and its superstructure is flexible.

NSViewHeightSizable

The height of the receivers is flexible.

NSViewMaxYMargin

The top margin between the receiver and its superstructure is flexible.


So you can do it like this:

 [YourOutlet setAutoresizingMask: NSViewMinXMargin | NSViewMinYMargin]; 
+11
source share

All Articles