【发布时间】:2017-04-17 04:58:47
【问题描述】:
我想要使用加速度计值向上、向下、向左和向右移动一个超大图像。我创建了以下有效的代码,但图像以不同的步骤移动并且滑动不顺畅。
float[] matrix = new float[9];
mMatrix.getValues(matrix);
if (accelerometerValues[0] < MOVE_RIGHT_LIMIT) {
mMatrix.setTranslate(matrix[2] + 10, matrix[5] );
mSchematicDiagram.setImageMatrix(mMatrix);
Log.d("PROJECTA_SENSOR", "Moving Right");
在这种用例中使用 ImageView 矩阵上的 setTranslate 是否正确,您将如何创建这种平滑过渡?
【问题讨论】:
标签: android android-imageview android-sensors