Upravit

Sdílet prostřednictvím


UIView.SetNeedsLayout Method

Definition

Sets whether subviews need to be rearranged before displaying.

[Foundation.Export("setNeedsLayout")]
public virtual void SetNeedsLayout ();
abstract member SetNeedsLayout : unit -> unit
override this.SetNeedsLayout : unit -> unit
Attributes

Remarks

If the state of your view changes in response to some API calls, instead of changing the layout manually in response to the change, you should invoke this method which will flag the view for a layout. The layout event will then be processed the next time the main loop runs. By using this approach, you can coalesce multiple changes to the layout in a single pass.

Applies to