欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

簡單位移動畫TranslateAnimation

系統 2027 0
已不再推薦補間動畫,請使用屬性動畫;
http://blog.csdn.net/guolin_blog/article/details/43536355
http://blog.csdn.net/guolin_blog/article/details/43816093


動畫中的View的點擊判斷
http://blog.csdn.net/seker_xinjian/article/details/7236945
Android 動畫框架詳解
http://www.ibm.com/developerworks/cn/opensource/os-cn-android-anmt1/index.html


簡單位移動畫TranslateAnimation

每次點擊往前100或往后100.

    
package com.ql.app;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.LinearInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.Button;
import android.widget.ImageView;

public class App extends Activity {
	private Button btn_0,btn_1;
	private ImageView iv;
	private int count;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        iv = (ImageView)findViewById(R.id.iv);
        iv.bringToFront();
        btn_0=(Button)findViewById(R.id.btn_0);
        btn_0.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				TranslateAnimation animation = new TranslateAnimation(count*100, 100+count*100, 0, 0);
				animation.setInterpolator(new LinearInterpolator());
				animation.setDuration(400);
				animation.setFillAfter(true);
				iv.startAnimation(animation);
				count++;
			}
		});
        
        btn_1=(Button)findViewById(R.id.btn_1);
        btn_1.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				TranslateAnimation animation = new TranslateAnimation(count*100, -100+count*100, 0, 0);
				animation.setInterpolator(new LinearInterpolator());
				animation.setDuration(400);
				animation.setFillAfter(true);
				iv.startAnimation(animation);
				count--;
			}
		});
        
        
    }
}

  


android 自定義Animation
http://lipeng88213.iteye.com/blog/1199120
http://www.ophonesdn.com/article/show/185

簡單循環動畫的實現:
簡單位移動畫TranslateAnimation

    
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
	<alpha
		android:interpolator="@android:anim/linear_interpolator" 
		android:fromAlpha="1.0"
		android:toAlpha="0.1"
		android:duration="2000"
		android:repeatCount="infinite"
		android:repeatMode="reverse"
		/>
</set>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator">
	<translate 
	android:fromXDelta="0" 
	android:toXDelta="100%" 
	android:duration="2000"
	android:repeatCount="infinite"
	android:repeatMode="reverse"
	/>
</set>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
	<scale 
	    android:fromXScale="1.0" 
	    android:toXScale="2.0"
		android:fromYScale="1.0" 
		android:toYScale="2.0" 
		android:pivotX="50%"
		android:pivotY="50%" 
		android:duration="2000" 
		android:repeatCount="infinite"
		android:repeatMode="reverse"
		android:interpolator="@android:anim/linear_interpolator" 
		/>
</set>

  

使用:
    
import android.app.Activity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;

public class App extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Animation alpha = AnimationUtils.loadAnimation(this, R.anim.anim_alpha);
        Animation translate = AnimationUtils.loadAnimation(this, R.anim.anim_translate);
        Animation scale = AnimationUtils.loadAnimation(this, R.anim.anim_scale);
        
        TextView tv=(TextView)findViewById(R.id.tv);
        tv.startAnimation(alpha);
        ImageView iv0=(ImageView)findViewById(R.id.iv0);
        ImageView iv1=(ImageView)findViewById(R.id.iv1);
        ImageView iv2=(ImageView)findViewById(R.id.iv2);
        iv0.startAnimation(alpha);
        iv1.startAnimation(translate);
        iv2.startAnimation(scale);
        
    }
}

  

簡單位移動畫TranslateAnimation


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产福利在线免费 | 国产成人av一区二区三区 | 波多野结衣全部系列在线观看 | 亚洲成人福利在线观看 | 免费观看黄色a一级视频播放 | 精品久久久久久久久久 | 日韩欧美色图 | 日韩欧美精品在线观看 | 99久久99久久精品免费看蜜桃 | 色综合99天天亚洲 | 国产免费av在线 | 精品人成| 制服丝袜成人动漫 | 台湾佬中文娱乐2222vvv | 又爽又黄axxx片免费观看 | 亚洲精品乱码久久久久久按摩观 | 日韩深夜福利视频 | 国产一级特黄aa大片爽爽 | 国产人成精品综合欧美成人 | 国产一区二区在线免费观看 | 无遮挡很爽很污很黄的网站w | 国产区久久| 国产精品秒播无毒不卡 | 91中文在线观看 | 天天噜天天干 | 亚洲欧美日韩中文字幕在线不卡 | 成人在线免费视频播放 | 日韩一区二区福利 | 精品久久久久久久人人人人传媒 | 日穴视频在线观看 | 亚洲无毛视频 | 亚洲精品国产成人无码区A片 | 久久综合九色综合桃花 | 欧美日韩亚洲一区二区三区在线观看 | 欧美成人二区 | 在线视频97 | 十八勿入| 久久er视频| 狠狠视频 | 欧美日韩精品一区二区三区四区 | 欧美亚洲精品在线 |