android view(image,imageButton,…)的旋转

废话不多,上代码:final Animation rotateAnimation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);final ImageButton buttonDraw = (ImageButton) findViewById(R.id.drawer_button);buttonDraw.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {rotateAnimation.setDuration(300);buttonDraw.startAnimation(rotateAnimation);}});第一行前两个参数是旋转的起始与终止位置,后面四个看提示的pivot,,就知道是个轴,0.5代表组件的中间。

无论身处何处,只要有一颗放松而美好的心态,生活便是美好!

android view(image,imageButton,…)的旋转

相关文章:

你感兴趣的文章:

标签云: