zoukankan      html  css  js  c++  java
  • 安卓——animotion

    1. 在 layout下建立文件夹 animator写入动画文件xml
    <?xml version="1.0" encoding="utf-8"?>
    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="textSize"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="10.0"-->
    <!--android:valueTo="40.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse"-->
    <!--/>-->
    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="alpha"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="1.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->

    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="translationX"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="300.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->
    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="rotation"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="360.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="restart" />-->

    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="scaleX"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="2.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->



    <!--android:translationX=""-->
    <!--android:alpha=""-->
    <!--android:rotation=""-->
    <!--android:scaleX=""-->

    <set android:ordering="together"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:propertyName="rotationY"
    android:valueType="floatType"
    android:valueFrom="0.0"
    android:valueTo="360.0"
    android:repeatCount="-1"
    android:repeatMode="restart" />

    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="translationY"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="300.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->

    <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="3000"
    android:propertyName="textSize"
    android:valueType="floatType"
    android:valueFrom="10.0"
    android:valueTo="16.0"
    android:repeatCount="-1"
    android:repeatMode="reverse"
    />

    <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:propertyName="textColor"
    android:valueType="colorType"
    android:valueFrom="#95868686"
    android:valueTo="#951455ed"
    android:repeatCount="-1"
    android:repeatMode="reverse"
    />

    </set>





    2. JAVA加载
    tv=(TextView) findViewById(R.id.tv);
    // 1 context
    Animator animator= AnimatorInflater.loadAnimator(MainActivity.this,R.animator.animator);
    animator.setTarget(tv);
    animator.start();
  • 相关阅读:
    zoj 2406 Specialized FourDigit Numbers
    hdu 1016 Prime Ring Problem(深度优先搜索)
    【ObjectiveC】08self关键字
    【ObjectiveC】09空指针和野指针
    【零基础学习iOS开发】【01前言】01开篇
    【零基础学习iOS开发】【01前言】03前景和难易度分析
    多线程编程1NSThread
    【零基础学习iOS开发】【02C语言】02第一个C语言程序
    多线程编程2NSOperation
    【零基础学习iOS开发】【01前言】02准备
  • 原文地址:https://www.cnblogs.com/embaobao/p/10720862.html
Copyright © 2011-2022 走看看