显示pushviewcontroller动画看起来像presentModalViewController
是否可以显示 pushViewController
动画,看起来像 presentModalViewController
但具有 pushViewController
的后台功能?
Is it possible to show pushViewController
animation look like presentModalViewController
but that has background functionality of pushViewController
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您想要淡入淡出动画,此方法有效。
If you want to a fade animation, this approach works.
试试这个:
Try this :
对于显示 PushViewConttroler 动画,如下代码所示,
对于 Push
和 POP ,
有 1 个问题,即它在向上/向下移动时显示浅黑色背景,< br>
正在努力,一旦完成就在这里发布新代码。
For display PushViewConttroler animation as Present below code is working,
For Push
And for POP
There is 1 issue though, that its display light black background when its going up/down,
Working on that, As soon as its done post new code here.
对于所有尝试使用 Xamarin (C#) 等效代码的人
从上面 @hardik Thakkar 的回答来看,动画期间有黑色背景的问题,一切都好。
对于 POP
对于推送
For All Trying in Xamarin (C#) equivalent Code
From Answer by @hardik Thakkar above, Has the issue of Black backgound during animation, rest all good.
For POP
For Push
您应该考虑执行以下操作:
其中 OFF_SCREEN 是屏幕下方的某个 CGRect,例如 (0, 481, 320, 480)。然后使用动画块将viewcontroller的view的frame.origin调整为(0, 0)。您可能想要在 viewDidLoad 或 viewDidAppear 中执行动画块。
You should consider doing something like:
where OFF_SCREEN is some CGRect below the screen, like (0, 481, 320, 480). Then use an animation block to adjust the viewcontroller's view's frame.origin to be (0, 0). You would probably want to do the animate block in viewDidLoad or viewDidAppear.