Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 接触面上的圆旋转_Java_Android_Geometry - Fatal编程技术网

Java 接触面上的圆旋转

Java 接触面上的圆旋转,java,android,geometry,Java,Android,Geometry,仅当单击一次后,此按钮上的圆旋转才起作用,但它不起任何作用 这是我的密码: setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { int n = 0; postInvalidate(); for(int i=0; i<360; i++){

仅当单击一次后,此按钮上的圆旋转才起作用,但它不起任何作用

这是我的密码:

    setOnTouchListener(new OnTouchListener() {

        public boolean onTouch(View v, MotionEvent event) {
            int n = 0;
            postInvalidate();
            for(int i=0; i<360; i++){
                setRotationX(n + 1);
            }
            forceLayout();
setOnTouchListener(新的OnTouchListener(){
公共布尔onTouch(视图v,运动事件){
int n=0;
后验证();

对于(int i=0;i要制作动画,您需要在res文件夹中创建一个文件夹“anim”,并添加这样一个xml文件:

<?xml version="1.0" encoding="UTF-8"?> 
<rotate xmlns:android="http://schemas.android.com/apk/res/android" 
    android:fromDegrees="0" 
    android:toDegrees="360" 
    android:pivotX="50%" 
    android:pivotY="50%"
    android:duration="1000"/>

要制作动画,您需要在res文件夹中创建一个文件夹“anim”,并添加这样一个xml文件:

<?xml version="1.0" encoding="UTF-8"?> 
<rotate xmlns:android="http://schemas.android.com/apk/res/android" 
    android:fromDegrees="0" 
    android:toDegrees="360" 
    android:pivotX="50%" 
    android:pivotY="50%"
    android:duration="1000"/>

如果您使用goodm解决方案,您应该在清单中添加以下内容:

<supports-screens android:resizeable="true"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="true"/>


这适用于ICS和预ICS。

如果您使用goodm解决方案,您应该在清单中添加以下内容:

<supports-screens android:resizeable="true"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="true"/>


这是针对ICS和预ICS的。

触摸后启动动画并不容易?注释为thanx,但我如何制作这样的动画?触摸后启动动画不容易?注释为thanx,但我如何制作这样的动画?我只知道,有了这些代码,所有动画和祝酒都很好。我只知道,wit所有的动画和祝酒代码都很好。