UWP 页面过渡动画 [英] UWP Page Transition Animations
本文介绍了UWP 页面过渡动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 Windows 10 UWP 中编程.我在 Xaml 中有一个框架,当用户从页面导航到另一个页面时,我希望页面/内容向左滑动和离开屏幕.知道如何制作帧导航动画吗?
I programing in Windows 10 UWP. I have a Frame in Xaml that I would like to have the Page/Content to slide left and off screen when the use navigates away from the page to another page. Any Idea how to do Frame Navigation Animations?
推荐答案
尝试使用内置动画:
protected virtual void SetUpPageAnimation()
{
TransitionCollection collection = new TransitionCollection();
NavigationThemeTransition theme = new NavigationThemeTransition();
var info = new ContinuumNavigationTransitionInfo();
theme.DefaultNavigationTransitionInfo = info;
collection.Add(theme);
this.Transitions = collection;
}
在Page的constructor
中调用这个方法,你会发现进入或离开一个Page
都会有动画.
Call this method in Page's constructor
and you will find that there will be animation when you enter or leave a Page
.
名称以Info
结尾的内置动画很少,你应该自己尝试一下.
There are few build-in animations which names end with Info
, you should try them by yourself.
这篇关于UWP 页面过渡动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文