UIKit.UIView.AddSubview Method
Adds the specified view as a subview of this view.

Syntax

[Foundation.Export("addSubview:")]
public virtual void AddSubview (UIView view)

See Also

UIView.Subviews
UIView.RemoveFromSuperview

Parameters

view
The UIKit.UIView to add as a nested view of this view.

Remarks

UIView.AddSubview appends the view to the end of this UIKit.UIView's UIView.Subviews. The methods UIView.InsertSubview, UIView.InsertSubviewBelow, and UIView.InsertSubviewAbove can be used to control the order.

To remove a UIKit.UIView from UIView.Subviews, call UIView.RemoveFromSuperview on the child UIKit.UIView.

Since UIKit.UIViews can only have direct ancestor, this will overwrite the existing UIView.Superview of the view.

A number of methods are called when a subview is added or removed:

The following diagram shows the sequence of calls resulting from a call to UIView.AddSubview. Note that the calls to UIView.WillMoveToWindow and UIView.MovedToWindow occur shortly after UIView.AddSubview has completed.

Requirements

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