zoukankan      html  css  js  c++  java
  • Android动画例子。

    例子一: 补间动画效果,从右进,从左出。

    ImageSwitcher mImageSwitcher = new ImageSwitcher(this);
    mImageSwitcher.setFactory(this);
    
    mImageSwitcher.setInAnimation(this, R.anim.slide_big_in_right);
    mImageSwitcher.setOutAnimation(this, R.anim.slide_big_out_right);

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate
            android:fromXDelta="1920"
            android:toXDelta="0"
            android:fromYDelta="0"
            android:toYDelta="0"
            android:duration="2000"
            android:interpolator="@android:anim/decelerate_interpolator" />
    </set>
    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate
            android:fromXDelta="0"
            android:toXDelta="-1920"
            android:fromYDelta="0"
            android:toYDelta="0"
            android:duration="2000"
            android:interpolator="@android:anim/decelerate_interpolator" />
    </set>

    例子二:补间动画效果,渐变。

        ImageSwitcher mImageSwitcher = new ImageSwitcher(this);
            mImageSwitcher.setFactory(this);
    
            AlphaAnimation inAnim = new AlphaAnimation(0, 1);
            inAnim.setDuration(300);
            mImageSwitcher.setInAnimation(inAnim);
            AlphaAnimation outAnim = new AlphaAnimation(1, 0);
            outAnim.setDuration(400);
            mImageSwitcher.setOutAnimation(outAnim);
  • 相关阅读:
    wcf通道Channel
    固定位置右下角
    小闹钟(无样式)
    CSS小注意(初级)
    java少包汇总
    maven的pom.xml配置
    myeclipse 手动安装 lombok
    Could not synchronize database state with session
    (转)myeclipse插件—SVN分支与合并详解【图】
    Nginx的启动、停止与重启
  • 原文地址:https://www.cnblogs.com/lipeineng/p/5338182.html
Copyright © 2011-2022 走看看