如何用RotateAnimation实现绕Y轴旋转 不用XML,代码实现,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 package com.karl;import android.app.Activity;import android.os.Bundle;import android.view.MotionEvent;import android.view.animation.AccelerateDecelerateInterpolator;import android.view.animation.Animation;import android.view.animation.ScaleAnimation;public class TestAnimation extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void startAnimation() { Animation anim = null;// anim = new RotateAnimation(0.0f, +360.0f);// anim = new ScaleAnimation(1.0f, 2.0f, 1.0f, 2.0f, 0.5f, 0.5f); anim = new ScaleAnimation(1.0f, 1.4f, 1.0f, 1.4f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setInterpolator(new AccelerateDecelerateInterpolator()); anim.setDuration(3000); findViewById(R.id.textView).startAnimation(anim); } @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: startAnimation(); break; } return true; }}很久以前写的了 自己看看 大哥 自己看下代码好不// anim = new RotateAnimation(0.0f, +360.0f);这个被注释掉了这个是包含3中animation的例子 如何用RotateAnimation实现绕Y轴旋转sorry 才反应过来被你的题目弄迷糊了因为绕Y轴旋转是类似3维的 所以RotateAnimation不行(至少我不知道怎么实现)要想实现绕Y轴旋转,那用android.graphics.Camera 我也想遇到这个问题,有会的帮忙解答一下,用xml也可以。 android 实现IP拨号 为什么observer在service中不能启动,请大侠们帮忙看看 Android 多点触摸和手势设计 Eclipse中,如何查看函数声明的帮助文档? 愁人的ANR(求助) 手机休眠状态下,alarmmanager不准的问题 求推荐有什么好的Android方面的书 高分求助类似微信朋友圈,特别是要求有下面的评论功能 android 一个问题 notification自定义单击事件 欢迎大家参观和指导以及喷水,自己做的第一个应用,打地鼠游戏(附源码) 安装了Android模拟器,然后在里面下载、安装了几个软件,然后被提示“存储空间不足”。
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;public class TestAnimation extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
} public void startAnimation() {
Animation anim = null;
// anim = new RotateAnimation(0.0f, +360.0f);
// anim = new ScaleAnimation(1.0f, 2.0f, 1.0f, 2.0f, 0.5f, 0.5f);
anim = new ScaleAnimation(1.0f, 1.4f, 1.0f, 1.4f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setInterpolator(new AccelerateDecelerateInterpolator());
anim.setDuration(3000);
findViewById(R.id.textView).startAnimation(anim);
} @Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
startAnimation();
break;
}
return true;
}
}很久以前写的了 自己看看
大哥 自己看下代码好不
// anim = new RotateAnimation(0.0f, +360.0f);
这个被注释掉了
这个是包含3中animation的例子
被你的题目弄迷糊了
因为绕Y轴旋转是类似3维的 所以RotateAnimation不行(至少我不知道怎么实现)要想实现绕Y轴旋转,那用android.graphics.Camera