0

我想一张一张地显示如下图所示的旋转图像。我如何在xml中编码。我无法使用 android:rotation="20" 旋转图像。我必须显示图像中显示的图像,从左到右一对一。

在此处输入图像描述

4

3 回答 3

1
public class Rotate {

public static Bitmap rotate(Bitmap src, float degree) {
    // create new matrix
    Matrix matrix = new Matrix();
    // setup rotation degree
    matrix.postRotate(degree);

    // return new bitmap rotated using matrix
    return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
}

}

于 2013-01-25T11:21:52.850 回答
0

最好是写方法,在里面写RotateAnimation代码,并相应地传递参数来旋转每一个图像。

于 2012-10-16T06:48:52.913 回答
0

看看这段代码

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android" 
        android:fromDegrees="90"
        android:toDegrees="90"
        android:pivotX="50%"
        android:pivotY="50%"
        android:drawable="@drawable/image">
</rotate>

确保你android:fromDegrees是正确的。

于 2012-10-16T07:00:15.740 回答