Android ViewAnimation(tween animation补间动画)文档教程_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:40:29
Original
885 people have browsed it

XML注意事项:

在res/anim/目录下,XML文件只能有 , , , 中一个根元素,set标签下默认动画同时进行,想要顺序进行需要startOffset元素。

注意pivotX动画中X的中间坐标,如旋转:50是指相对父View的50%,50%是相对自身View的50%

例子:

     
Copy after login


ImageView spaceshipImage = (ImageView) findViewById(R.id.spaceshipImage);Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump);spaceshipImage.startAnimation(hyperspaceJumpAnimation);
Copy after login

想在特定时间开始动画,可以使用 Animation.setStartTime()方法,通过View.setAnimation().方法设置给View。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!