編輯

共用方式為


UIView.SetNeedsDisplayInRect(CGRect) Method

Definition

Marks a region of the view as dirty and queues a redraw operation on that region.

[Foundation.Export("setNeedsDisplayInRect:")]
public virtual void SetNeedsDisplayInRect (CoreGraphics.CGRect rect);
abstract member SetNeedsDisplayInRect : CoreGraphics.CGRect -> unit
override this.SetNeedsDisplayInRect : CoreGraphics.CGRect -> unit

Parameters

rect
CGRect

The region that will be marked as dirty.

Attributes

Remarks

This method is invoked if a region of the contents of the view need to be refreshed due to a change of state or geometry. Invoking this method will cause the Draw(CGRect) method to be invoked.

Alternatively you can use the SetNeedsDisplayInRect(CGRect) method if you want to repaint the entire view.

Applies to