android初学------使用ScaleAnimation 动画实现放大缩小效果

Animation.RELATIVE_TO_SELF  自身为中心放大 或缩小
//缩小
				ScaleAnimation animation_suofang =new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f, 
						Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 
				
		animation_suofang.setDuration(900);						//执行时间
		animation_suofang.setRepeatCount(-1);					//重复执行动画
		animation_suofang.setRepeatMode(Animation.REVERSE);   	//重复 缩小和放大效果
		image.startAnimation(animation_suofang);				//使用View启动动画






你可能感兴趣的:(android)