gpt4 book ai didi

uiview - BeginAnimations 和 CommitAnimations with NavigationController.PushViewController

转载 作者:行者123 更新时间:2023-12-01 13:06:46 25 4
gpt4 key购买 nike

当我将 Controller 插入导航中时,我试图让基本的翻转动画过渡正常工作。下面的代码翻转 View ,但是 View 首先出现(每个元素淡入),然后翻转发生。是否可以使用 UINavigationController 制作翻转动画?

任何指针都很好,我为 Monotouch 找到的示例是在另一个 View 内的 View 上执行动画。

void ToolbarButtonClick()
{
InformationController controller = new InformationController();
NavigationController.PushViewController(controller,true);
}

public class InformationController : UIViewController
{
public override void ViewDidLoad ()
{
UIView.BeginAnimations("Flip");
UIView.SetAnimationDuration(1.0);
UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromRight,View,true);

base.ViewDidLoad ();
Title = "Information";
}

public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
}

public override void ViewDidAppear (bool animated)
{
base.ViewDidAppear (animated);
UIView.CommitAnimations();
}
}

最佳答案

我在那里,但 View 需要从 NavigationController 中获取:

// Push the controller first or the Title doesn't animate
NavigationController.PushViewController(controller,false);

UIView.BeginAnimations(null,IntPtr.Zero);
UIView.SetAnimationDuration(1);
UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromLeft,
NavigationController.View,true);
UIView.CommitAnimations();

关于uiview - BeginAnimations 和 CommitAnimations with NavigationController.PushViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2532932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com