无论方向如何,如何将飞入框设置为屏幕中心? [英] How to animate a fly-in box to the centre of the screen regardless of orientation?

查看:91
本文介绍了无论方向如何,如何将飞入框设置为屏幕中心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Blend和Visual Studio 2013 Pro,所以希望这个问题与此相关...

I'm using Blend with Visual Studio 2013 Pro, so hope this question is relevant here...

我想动画一个框进入屏幕中心,然后在延迟后再次飞出。

I want to animate a box to fly into the center of the screen and then fly out again after a delay.

设备设置为横向时没问题,但是如果我更改为纵向方向框不再飞到屏幕中心,它走得太远。

No problem achieving this with the device set to landscape orientation, but if I change to portrait orientation the box no longer flies to the centre of the screen, it goes too far.

有没有一种方法,而不是指定翻译的绝对位置,我可以指定它是屏幕宽度的一半?

Is there a way that instead of specifying absolute position for the translate, I can specify it to be half the screen width?

还是有另一种方法可以保证我的盒子无论屏幕方向如何都能转换到屏幕中心?

Or is there another way I can guarantee my box translates to the centre of the screen regardless of screen orientation?

谢谢 - Rich

Thanks - Rich

推荐答案

您好

您必须为横向创建单独的视觉状态肖像和每个你将定义动画的框,并将框设置在中心。

you have to create separate visual states for landscape and portrait and in each you will define  the animated  box to fly and set the box at centre.

谢谢 


这篇关于无论方向如何,如何将飞入框设置为屏幕中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆