Edytuj

Udostępnij za pośrednictwem


UIViewController.EndAppearanceTransition Method

Definition

With BeginAppearanceTransition(Boolean, Boolean), tells child UIViewControllers that their child views have just appeared or disappeared.

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

Remarks

This method, along with BeginAppearanceTransition(Boolean, Boolean), should be used to alert child UIViewControllers that their view or views are about to be shown or hidden. The application developer must invoke these methods and must not call ViewWillAppear(Boolean), ViewDidAppear(Boolean), ViewWillDisappear(Boolean), or ViewDidDisappear(Boolean) directly.

The following code, from the “Media Notes” sample, demonstrates the use of BeginAppearanceTransition(Boolean, Boolean) and EndAppearanceTransition(). The code snippet shows the child UIViewController being removed from the display (isAppearing is false) in an animated mirror (animated is true). The call to BeginAppearanceTransition(Boolean, Boolean) occurs and then EndAppearanceTransition() is called at the end of the specified animation.

commentViewIsVisible = false;
commentViewController.WillMoveToParentViewController (null);
commentViewController.BeginAppearanceTransition (false, true);
UIView.Animate (0.5f, () => {
    commentView.Alpha = 0.5f;
}, () => { 
    commentView.RemoveFromSuperview ();
    commentViewController.EndAppearanceTransition ();
    commentViewController.RemoveFromParentViewController ();
});

Applies to

See also