- 浏览: 20979 次
最新评论
1 AnimationSet的使用方法
什么是AnimationSet
1 AnimationSet是Animation的子类
2 一个AnimationSet包含了一系列的Animation
3 针对AnimationSet设置一些Animation的常见属性(如StartOffset,duration等),可以被包含在AnimationSet当中的Animation继承
2 Interpolator的使用方法
Interpolator定义了动画变化速率,在Animations框架中定义了以下几种Interpolator
AccelerateDecelerateInterpolator:在动画开始和结束的地方速率变化较慢,中间的时候加速
AccelerateInterpolator:在动画开始的地方速率改变较慢,然后加速
CycleInterpolator:动画循环播放特定次数,速率改变沿正弦曲线
DecelerateInterpolator:在动画开始的地方速率改变较慢,然后减速
LinearInterpolator:以均匀的速率改变
设置的地方就在set标签中的 android:interpolator="@android:anim/accelerate_interpolator"
而之后还有一个android:shareInterpolator="true" 从名字就可以看到这是为set中所有的动画设置Interpolator
如果要单独设置 则将shareInterpolator设为false 然后为每个动画中单独定义Interpolator
以上是在xml中设置,如果要在代码中设置
animationSet.setInterpolator(new AccelerateInterpolator());(也可以单独设置)
注意在AnimationSet的构造方法中有一个boolean参数,这个参数就是shareInterpolator的设定
3 Frame-By-Frame Animations的使用方法
1 在res/drawable中创建一个xml文件,定义Animation的动画播放序列 anim_nv.xml
2 为ImageView设置背景资源
3 通过ImageView得到AnimationDrawable
4 执行动画
什么是AnimationSet
1 AnimationSet是Animation的子类
2 一个AnimationSet包含了一系列的Animation
3 针对AnimationSet设置一些Animation的常见属性(如StartOffset,duration等),可以被包含在AnimationSet当中的Animation继承
AnimationSet animationSet = new AnimationSet(ture); AlpahaAnimation alpha = new AlphaAnimation(...); RotateAnimation rotate = new RotateAnimation(...); animationSet.addAnimation(alpha); animationSet.addAnimaion(rotate); animationSet.setDuration(2000); animationSet.setStartOffset(500); imageView.startAnimation(animationSet);
2 Interpolator的使用方法
Interpolator定义了动画变化速率,在Animations框架中定义了以下几种Interpolator
AccelerateDecelerateInterpolator:在动画开始和结束的地方速率变化较慢,中间的时候加速
AccelerateInterpolator:在动画开始的地方速率改变较慢,然后加速
CycleInterpolator:动画循环播放特定次数,速率改变沿正弦曲线
DecelerateInterpolator:在动画开始的地方速率改变较慢,然后减速
LinearInterpolator:以均匀的速率改变
设置的地方就在set标签中的 android:interpolator="@android:anim/accelerate_interpolator"
而之后还有一个android:shareInterpolator="true" 从名字就可以看到这是为set中所有的动画设置Interpolator
如果要单独设置 则将shareInterpolator设为false 然后为每个动画中单独定义Interpolator
以上是在xml中设置,如果要在代码中设置
animationSet.setInterpolator(new AccelerateInterpolator());(也可以单独设置)
注意在AnimationSet的构造方法中有一个boolean参数,这个参数就是shareInterpolator的设定
3 Frame-By-Frame Animations的使用方法
1 在res/drawable中创建一个xml文件,定义Animation的动画播放序列 anim_nv.xml
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/nv1" android:duration="500" /> <item android:drawable="@drawable/nv2" android:duration="500" /> <item android:drawable="@drawable/nv3" android:duration="500" /> <item android:drawable="@drawable/nv4" android:duration="500" /> </animation-list>
2 为ImageView设置背景资源
imageView.setBackgroundResource(R.drawable.anim_nv);
3 通过ImageView得到AnimationDrawable
AnimationDrawable animationDrawable = (AnimationDrawable) imageView.getBackground();
4 执行动画
animationDrawable.start();
发表评论
-
SQLite数据库
2011-10-21 11:12 9911。从www.sqlite.org下载SQLite 3.3.4 ... -
android中的有道词典实例
2011-10-19 22:51 8961、布局文件main.xml <?xml version ... -
mars老师的googleMap示例(二)
2011-10-15 17:14 847manifest.xml文件 <?xml version ... -
mars老师的googleMap(一)
2011-10-15 10:43 789一、申请 Apikey Apikey Apikey Apike ... -
Intent在android中的几种用法
2011-10-14 09:26 753如果是从BroadcastReceiver 启动一个新的Act ... -
基于Service与ContentProvider的音乐播放实例
2011-10-13 23:37 727Android的核心也就是Activi ... -
android之用户定位(一)
2011-10-13 19:53 16651、User Location 能做什么 1) 获取用户的位置 ... -
android之蓝牙操作(二)
2011-10-13 18:43 12711、修改本蓝牙设备的可见性 2、扫描周围可用蓝牙设备 步骤: ... -
android之蓝牙操作(一)
2011-10-13 16:35 1207与蓝牙相关的API 1、BluetoothAdapter ... -
Android学习之JSON数据解析
2011-10-12 13:30 676在Android应用开发中,常用的数据交换格式有XML和JSO ... -
android中的JSON解析
2011-10-12 10:17 8851 。 什么是JSON 就是现在网络上比较流行 ... -
Animations的使用(六)
2011-10-11 17:44 1115LayoutAnimationController的使用方法( ... -
Animations使用 (四)
2011-10-11 17:36 549Animations的第二种使用方法(第一种见1) 步骤: ... -
android面试
2011-10-10 21:12 763为什么要用ContentProvider?它和sql的实现上有 ... -
android中的animations的用法(三)
2011-10-10 21:07 691一 LayoutAnimationController ... -
android中的animations的用法(二)
2011-10-10 20:59 767一 AnimationSet 的用法 二 Interpol ... -
android中的animations的用法 (一)
2011-10-10 20:56 1306Animations 可分为两大类: 一 Tweened A ...
相关推荐
所有的角色都采用了Mecanim人形动画的结构,所以你可以很轻松地嵌入你自己的角色,其还支持有五根手指的手以适应有着高细节要求的模型。我们所提供的动画控制器简洁明了,您或可以将动画插入在您的现有设置当中。...
Autolayout 实现百思不得姐总结##精华模块切换子控制器,使用系统的切换方法实现把全部\视频\声音\图片\段子五个topic控制器添加为EssenceVc的子控制器,通过以下方法切换- (void)transitionFromViewController:...
Display DHTML animations Automate form validation Draw dynamic pie charts Make HTML elements draggable Define keyboard shortcuts for web applications Create Ajax-enabled tool tips Use XPath and ...
Display DHTML animations Automate form validation Draw dynamic pie charts Make HTML elements draggable Define keyboard shortcuts for web applications Create Ajax-enabled tool tips Use XPath and ...
仅滚动简单指示使用СSS3动画滚动页面的可能性。 功能可以在所有现代和许多较旧的浏览器上使用具有SASS版本以供重建(仅适用于开发人员)包括颜色,帮助Just Scroll Simple指示使用СSS3动画滚动页面的可能性。 功能...
进度时间表栏高度可定制的动画进度时间轴栏,用于强调应有的流程 ... 否则香草js 设计为可消耗的React组件用于外观定制的模块化模板系统数据是模拟垃圾建模的退货清单去做*做出回应*创建五个皮肤插件*发布完整的api文件
Flawless App是我们的第一家公司,我们为五人团队所取得的成就感到自豪。 自2015年以来,我们为设计师和开发人员推出了功能强大的工具,其中包括 , , 。 我们还在社区推动的计划中投入了大量的爱心和关怀。 很棒...
秒表易于使用,您可以使用按钮将其重置。 接触 :telephone_receiver: 名字-Nidhi Gahlawat 领英个人资料-https //www.linkedin.com/in/nidhi-gahlawat-01947818a/ 链接到时钟 :link: 在各种尺寸的设备上都能很...
简易CSS布局 演示版 前言 仅用于练习和备份 关于样式的颜色设置,这里存在一些问题,但是我不想修改它们。 如果您想通过本演示进行练习 首先,您需要在“演示”列中查看演示,并自己写下代码 如果您无法实现这些...
Javis.jl:Julia动画和可视化
1.1.1ArcView(单用户使用许可)的安装 ....................................................................4 1.1.2ArcGIS(浮动使用许可)的安装 ..............................................................