UIKit.UIView.AutoresizingMask Property
A bitmask that specifies how the receiver should resize itself when it's super-view's bounds change.

Syntax

[get: Foundation.Export("autoresizingMask")]
[set: Foundation.Export("setAutoresizingMask:")]
public virtual UIViewAutoresizing AutoresizingMask { get; set; }

See Also

UIView.AutoResizingMask

Value

The default value is UIViewAutoresizing.None.

Remarks

Application developers may wish to use the more powerful Auto Layout capability rather than the older Autoresizing Mask capability.

The UIView.AutoresizingMask is a powerful feature that handles a good deal of the complexity of resizing views, such as occurs during device rotation. However, it is not necessarily a complete solution. For instance, when using a UIKit.UIScrollView, logic may require the UIScrollView.ContentSize to be resized. In such situations, application developers may subscribe to the UIDeviceOrientationDidChangeNotification and implement a custom method with additional resizing logic:

C# Example

//During initialization, subscribe to orientation changes              
NSNotificationCenter.DefaultCenter.AddObserver ("UIDeviceOrientationDidChangeNotification", DeviceRotated);

protected void DeviceRotated (NSNotification notification)
{
    //Code to resize UIScrollView.ContentSize and other custom on-rotation logic
}
              

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0