@Override public void onClick(View v) {switch (v.getId()) {case R.id.btn_rotate://360度旋转ObjectAnimator rotate = ObjectAnimator.ofFloat(img, "rotation", 0f, 360f);rotate.setDuration(2500);//时间rotate.setRepeatCount(3);//次数+1rotate.start();//开始break;case R.id.btn_translation://平移//将TextView先向右,然后再移动回来 -500f是向左移动/* float dis = TranslationX();ObjectAnimator translation = ObjectAnimator.ofFloat(img, "translationX", dis,500f,dis);*///将img先向右移动 不回来ObjectAnimator translation = ObjectAnimator.ofFloat(img, "translationX", 500f);translation.setDuration(2500);translation.start();break;case R.id.btn_zoom://缩放ObjectAnimator zoom = ObjectAnimator.ofFloat(img, "scaleX", 1f, 3f, 1f);zoom.setDuratio
本文发布于:2024-02-02 22:05:42,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170688274246746.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |