zoukankan      html  css  js  c++  java
  • 属性动画 常用属性及View常用方法

    View类中,常用于属性动画的属性:

    translationX and translationY: These properties control where the View is located as a delta from its left and top coordinates which are set by its layout container.
    rotation, rotationX, and rotationY: These properties control the rotation in 2D (rotation property) and 3D around the pivot point.
    scaleX and scaleY: These properties control the 2D scaling of a View around its pivot point.
    pivotX and pivotY: These properties control the location of the pivot point, around which the rotation and scaling transforms occur. By default, the pivot point is located at the center of the object.
    x and y: These are simple utility properties to describe the final location of the View in its container, as a sum of the left and top values and translationX and translationY values.
    alpha: Represents the alpha transparency on the View. This value is 1 (opaque) by default, with a value of 0 representing full transparency (not visible).

     android.view.ViewPropertyAnimator

    ObjectAnimator animX = ObjectAnimator.ofFloat(myView, "x", 50f);
    ObjectAnimator animY = ObjectAnimator.ofFloat(myView, "y", 100f);
    AnimatorSet animSetXY = new AnimatorSet();
    animSetXY.playTogether(animX, animY);
    animSetXY.start();
    PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("x", 50f);
    PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("y", 100f);
    ObjectAnimator.ofPropertyValuesHolder(myView, pvhX, pvhY).start();

    viewPropertyAnimator

    myView.animate().x(50f).y(100f);
    = = = = = = = = = = = = = = = = = = 天道酬勤 = = = = = = 活在当下 = = = = = = = = = = = = = = = = = =
  • 相关阅读:
    /bin/bash^M: bad interpreter: No such file or dire
    ****LINUX命令(含GIT命令)个人总结
    创建和编辑 crontab 文件
    Linux下用于查看系统当前登录用户信息的4种方法
    linux下cat命令详解
    crontab 指定执行用户
    crontab定时运行git命令 更新代码库
    ubuntu添加环境变量【原创】
    ubuntu下设置环境变量的三种方法【转】
    笔记三、apache搭建gitweb【转】
  • 原文地址:https://www.cnblogs.com/brillian-Jin/p/9675721.html
Copyright © 2011-2022 走看看