更改 ViewFlipper 过渡的动画或持续时间
我有一个 ViewFlipper,有时我想让它在视图之间动画,有时我希望它立即在视图之间切换。
我正在尝试弄清楚如何做到这一点。
我尝试在切换之前更改动画、动画中和动画外,但如果这样做,当前视图会在动画过程中消失。
有人知道有办法做到这一点吗?
I have a ViewFlipper and sometimes I would like to have it animate between views and sometimes I want it to instantly switch between views.
I'm trying to figure out how to do this.
I tried changing the animation, in animation, and out animation before the switch but if I do that the current view disappears during the animation.
Anyone know of a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我面前没有确切的代码,但我记得您可以使用指定显示的子项(而不对其进行动画处理)
如果您想更改动画的持续时间,则必须指定您自己的 < code>In 和
Out
动画使用例如,您有一个动画 XML
/res/anim/animIn.xml
:在上面的示例中,动画在 500 毫秒内从右侧移入下一帧。
I don't have the exact code in front of me, but I recall that you could specify the displayed child (without animating to it) using
If you want to change the duration of the animation, you'll have to specify your own
In
andOut
animation usingWhere, for instance, you have an animation XML
/res/anim/animIn.xml
:In the example above, the animation moves the next frame in from the right in 500ms.