[转]android animation的应用实例

	public static void Translate(View view, float fromX, float toX, float fromY,
			   float toY, long durationMillis) {
			AnimationSet  as = new AnimationSet(true);
			  TranslateAnimation ta = new TranslateAnimation(fromX, toX, fromY,
			    toY);
			  ta.setFillAfter(true);
			  ta.setFillBefore(false);
			  ta.setDuration(durationMillis);
			  as.addAnimation(ta);
			  //as.setFillAfter(true);
			  //as.setFillBefore(false);
			  view.startAnimation(as);
			 }

猜你喜欢

转载自wmcxy.iteye.com/blog/1905559