Code example for AlphaAnimation

Methods: setDurationsetRepeatCountsetRepeatMode

0
	 * @param view 
	 */ 
 
	public void click1(View view) {
		// 透明度类(开始透明度,最终透明度) 
		AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f);
		// 动画的持续时间 
		animation.setDuration(2000);
		animation.setRepeatCount(Animation.INFINITE);
		animation.setRepeatMode(Animation.REVERSE);
		iv.startAnimation(animation);
	} 
 
	public void click2(View view) {
		ScaleAnimation animation = new ScaleAnimation(0.2f, 2.0f, 0.2f, 2.0f,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
				0.5f); 
		animation.setDuration(2000);
		animation.setRepeatCount(Animation.INFINITE);
		animation.setRepeatMode(Animation.REVERSE);
Stop searching for code, let great code find you!  Add Codota to your java IDE