首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏全栈程序员必看

    Android补间动画之ScaleAnimation、AlphaAnimation、RotateAnimation、TranslateAnimation、AnimationSet详解「建议收藏」

    先简单写出各个标签对应的类,方便大家理解: scale —— ScaleAnimation alpha —— AlphaAnimation rotate —— RotateAnimation translate RotateAnimation类对应Rotate标签,SDK文档地址:《RotateAnimation》 Rotate标签所具有的XML属性有: android:fromDegrees 开始旋转的角度位置 (Context context, AttributeSet attrs)  从本地XML文档加载动画,同样,基本不用 RotateAnimation(float fromDegrees, float toDegrees) RotateAnimation(float fromDegrees, float toDegrees, float pivotX, float pivotY) RotateAnimation fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) RotateAnimation

    3.5K21编辑于 2022-11-07
  • 来自专栏CSDN博客

    Android的View动画

    ,0.5f); //设置动画的时间长度 rotateAnimation.setDuration(2000); //设置重复的类型 rotateAnimation.setRepeatMode(Animation.REVERSE ); //设置重复的次数 rotateAnimation.setRepeatCount(2); //设置是否停留在最终状态 rotateAnimation.setFillAfter(false); // ,0.5f); rotateAnimation.setDuration(2000); rotateAnimation.setRepeatMode(Animation.REVERSE); rotateAnimation.setRepeatCount (2); rotateAnimation.setFillAfter(false); //添加旋转动画 animationSet.addAnimation(rotateAnimation); ScaleAnimation ); rotateAnimation.setRepeatCount(2); rotateAnimation.setFillAfter(false); //

    1.5K30发布于 2020-05-06
  • 来自专栏全栈程序员必看

    android scaleanimation动画,【Android动画九章】-RotateAnimation(旋转动画)和ScaleAnimation(尺寸动画)…

    【Android动画九章】-RotateAnimation(旋转动画)和ScaleAnimation(尺寸动画) public abstract class Animation extends Object java.lang.Object ↳ Android.view.animation.Animation Known Direct Subclasses AlphaAnimation, AnimationSet, RotateAnimation , ScaleAnimation, TranslateAnimation 同AlphaAnimation和TranslateAnimation一样,RotateAnimation和ScaleAnimation RotateAnimation 常用构造方法: RotateAnimation(float fromDegrees, float toDegrees, int pivotXType, float pivotXValue

    1.1K40编辑于 2022-09-27
  • 来自专栏用户10004205的专栏

    Unity 编辑器开发实战【Custom Editor】- 为UI视图制作动画编辑器

    EditorGUILayout.EndFadeGroup(); //RotateAnimation var rotateAnimation = animation.rotateAnimation; rotateAnimation.isCustom, () => { rotateAnimation.isCustom = false; EditorUtility.SetDirty(Target); } var rotateAnimation = animation.rotateAnimation; rotateAnimation.isCustom, () => { rotateAnimation.isCustom = false; EditorUtility.SetDirty(Target); }

    2K21编辑于 2022-08-29
  • 来自专栏项勇

    笔记73 | 实现音乐转盘的旋转和暂停效果

    RotateAnimation实现转动动画: package com.jikexueyuan.rotateanimation; import android.app.Activity; import android.os.Bundle ; public class MainActivity extends Activity { private RotateAnimation ra; @Override ; public class MainActivity extends Activity { private RotateAnimation ra; @Override rotateanimation.setInterpolator(new LinearInterpolator()); rotateanimation.setRepeatCount(ObjectAnimator.INFINITE } public void stop(){ rotateanimation.end(); statics = STOP; } }

    1.9K60发布于 2018-06-19
  • 来自专栏陶士涵的菜地

    [android] 优酷环形菜单-旋转动画

    度,顺时针转;构造函数:开始度数,结束度数,圆心x(宽度一半),圆心y(高度) 调用RotateAnimation对象的setDuration()方法,设置执行时间,参数:毫秒 调用RotateAnimation rotateAnimation=new RotateAnimation(0, 180, view.getWidth()/2, view.getHeight()); rotateAnimation.setDuration (1000); rotateAnimation.setFillAfter(true); rotateAnimation.setStartOffset(times); static void startAnimIn(RelativeLayout view) { RotateAnimation rotateAnimation=new RotateAnimation (180, 360, view.getWidth()/2, view.getHeight()); rotateAnimation.setDuration(1000); rotateAnimation.setFillAfter

    1.7K20发布于 2019-09-10
  • 来自专栏微卡智享

    学习|Android属性动画的组合动画之一--AnimationSet

    动画可以按先后顺序执行 支持背景色的修改 Animator 的子类 AnimationSet的使用 微卡智享 一般来我说我们在App中常用的都是一些视图动画:包括透明动画(AlphaAnimation)、旋转动画(RotateAnimation //透明度从0至1 AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1); //旋转两圈 RotateAnimation rotateAnimation=new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF Animation.REVERSE); animationSet.addAnimation(alphaAnimation); animationSet.addAnimation(rotateAnimation

    3.8K10发布于 2019-11-25
  • 来自专栏项勇

    笔记88 | 仿网易云音乐的圆盘指针动画

    Animation rotateAnimation = null ; int isAnimationState = -1; int time1,time2 = 0; private int = new RotateAnimation((time1),0,Animation.ABSOLUTE,9,Animation.ABSOLUTE,10); rotateAnimation.setDuration = new RotateAnimation(animAngle,0,Animation.ABSOLUTE,9,Animation.ABSOLUTE,10); rotateAnimation.setDuration (0); isAnimationState = 3; break; } rotateAnimation.setFillAfter( true); findViewById(R.id.album_hand).startAnimation(rotateAnimation); }

    1.2K30发布于 2019-04-28
  • 来自专栏刘晓杰

    android的Animation用法简介

    new AlphaAnimation(1.0f, 0.1f); alphaAnimation.setDuration(3000); RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF , 0.5f); rotateAnimation.setDuration(3000); animationSet.addAnimation (alphaAnimation); animationSet.addAnimation(rotateAnimation); imageView.startAnimation

    70320发布于 2019-03-01
  • 来自专栏老欧说安卓

    Android开发笔记(九十六)集合动画与属性动画

    集合动画AnimationSet 补间动画有四大类:透明度动画AlphaAnimation、旋转动画RotateAnimation、缩放动画ScaleAnimation、平移动画TranslateAnimation 0.5f); rotateAnimation.setDuration(3000); rotateAnimation.setFillAfter(true); } @Override public 0.5f); rotateAnimation2.setDuration(3000); rotateAnimation2.setFillAfter(true); if (animation.equals 0.5f); rotateAnimation.setDuration(3000); rotateAnimation.setFillAfter(true); } @Override public 0.5f); rotateAnimation2.setDuration(3000); rotateAnimation2.setFillAfter(true); if (animation.equals

    1.2K20发布于 2019-01-18
  • 来自专栏全栈程序员必看

    安卓方向传感器_自制悬挂式指南针

    android.support.v7.app.AppCompatActivity; import android.view.animation.Animation; import android.view.animation.RotateAnimation == Sensor.TYPE_ORIENTATION) { // 获取绕Z轴转过的角度 float degree = event.values[0]; // 创建旋转动画(反向转过degree度) RotateAnimation ra = new RotateAnimation(currentDegree, -degree, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF // 创建旋转动画(反向转过degree度) RotateAnimation ra = new RotateAnimation(currentDegree, -degree, Animation.RELATIVE_TO_SELF

    92120编辑于 2022-11-11
  • 来自专栏wangweijun

    Android进阶之绘制-自定义View完全掌握(一)

    package com.itcast.youkumenu; import android.view.View; import android.view.animation.RotateAnimation ra = new RotateAnimation(180, 360, view.getWidth() / 2, view.getHeight()); ra.setDuration(500 ra = new RotateAnimation(0, 180, view.getWidth() / 2, view.getHeight()); ra.setDuration(500) ra = new RotateAnimation(0, 180, view.getWidth() / 2, view.getHeight()); ra.setDuration(500) ra = new RotateAnimation(0, 180, view.getWidth() / 2, view.getHeight()); ra.setDuration(500)

    81140发布于 2020-01-20
  • 来自专栏Sorrower的专栏

    一起来做个拜年App吧!

    rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); //1.2 设置时长 rotateAnimation.setDuration(500); // rotateAnimation.setRepeatCount(1); // rotateAnimation.setRepeatMode(Animation.REVERSE); //1.3 保持动画结束 rotateAnimation.setFillAfter(true); //2. 动画集合 animationSet = new AnimationSet(true); animationSet.addAnimation(rotateAnimation

    87420发布于 2018-09-04
  • 来自专栏Android开发指南

    6.下拉刷新

    松开刷新的状态 private final int REFRESHING = 2;//正在刷新的状态 private int currentState = PULL_REFRESH; private RotateAnimation addHeaderView(headerView); } /** * 初始化旋转动画 */ private void initRotateAnimation() { upAnimation = new RotateAnimation (0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); upAnimation.setDuration(300); upAnimation.setFillAfter(true); downAnimation = new RotateAnimation (-180, -360, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f)

    2.1K40发布于 2018-05-14
  • 来自专栏向治洪

    android上拉下拉加载更多数据

    android.view.ViewGroup;   import android.view.animation.LinearInterpolator;   import android.view.animation.RotateAnimation  animation;   private RotateAnimation reverseAnimation;   // 用于保证startY的值在一个完整的touch事件中只被记录一次 private addHeaderView(headView, null, false);           setOnScrollListener(this);           animation = new RotateAnimation (0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);            (-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);           

    2.8K60发布于 2018-01-29
  • 来自专栏Linux内核深入分析

    Android 学习之补间(Tween)动画

    iView.startAnimation(ta); } 位移动画有两种构造方法,具体还需自己尝试尝试 d:旋转动画 public void RotateAnimation (View v) { //旋转开始角度和结束角度 //ra = new RotateAnimation(0, -15); //ra = new RotateAnimation (20, 360, iView.getWidth()/2, iView.getHeight()/2); ra = new RotateAnimation(0, 90, Animation.RELATIVE_TO_SELF

    76520编辑于 2022-05-08
  • 来自专栏7号代码

    Android开发高级进阶——传感器

    event.sensor.getType() == Sensor.TYPE_ORIENTATION){ float degree = - event.values[0]; RotateAnimation rotateAnimation = new RotateAnimation(mDegress, degree, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF , 0.5f); rotateAnimation.setDuration(100); mIvSensor.startAnimation(rotateAnimation

    1.6K20发布于 2018-09-28
  • 来自专栏全栈程序员必看

    Animation的使用「建议收藏」

    Animation(动画)有两种分类:补间动画(Tween)和帧动画(Frame) 补间动画主要有以下几种: 旋转(RotateAnimation) 平移(TranslateAnimation) 拉伸 rotateAnimation = new RotateAnimation(0, 180, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF , 0.5f); rotateAnimation.setDuration(5000); // 循环播放,参数循环的次数,会在setDuration的时间中循环完,循环为0~180,0~-180算一次 CycleInterpolator (rotateAnimation); /** * 动画集合 */ // 方法一: Animation set = AnimationUtils.loadAnimation(this, R.anim.set 所以动画都执行同一个变速器即set设置的变速器,false执行各自的变速器 AnimationSet set2 = new AnimationSet(false); set2.addAnimation(rotateAnimation

    98620编辑于 2022-11-15
  • 来自专栏向治洪

    android下拉加载更多

    private ImageView arrowImageView;// 箭头的图片 private ProgressBar progressBar;// 刷新进度 private RotateAnimation  animation;// 箭头向下动画 private RotateAnimation reverseAnimation;// 逆向箭头动画 private boolean isRecored 那就是可以在顶部和底部添加自定义的视图         setOnScrollListener(this);   // 箭头向下动画         animation = new RotateAnimation (0, -180,                   RotateAnimation.RELATIVE_TO_SELF, 0.5f,                   RotateAnimation.RELATIVE_TO_SELF (-180, 0,                   RotateAnimation.RELATIVE_TO_SELF, 0.5f,                   RotateAnimation.RELATIVE_TO_SELF

    3K60发布于 2018-01-26
  • 来自专栏米扑专栏

    Android Animations动画使用详解

    Java Code代码中 AlphaAnimation 渐变透明度动画效果 ScaleAnimation 渐变尺寸伸缩动画效果 TranslateAnimation 画面转换位置移动动画效果 RotateAnimation scale ScaleAnimation 一种是frame by frame(画面转换动画) XML中 JavaCode translate TranslateAnimation rotate RotateAnimation RotateAnimation RotateAnimation类对象定义 private RotateAnimation myAnimation_Rotate; RotateAnimation类对象构造 RotateAnimation(float fromDegrees, float toDegrees,              int pivotXType, float pivotXValue //第五个参数pivotXType为动画在Y轴相对于物件位置类型    //第六个参数pivotYValue为动画相对于物件的Y坐标的开始位置 myAnimation_Rotate = new RotateAnimation

    84420发布于 2019-02-19
领券