我希望 Android 屏幕上的图像在用户触摸时显得更小,并在用户松开图像时恢复到原始大小。我希望动画流畅,我也想利用最少的计算资源。如何最好地实现?
最佳答案
试试这段代码
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// do something here when touch
break;
case MotionEvent.ACTION_UP:
// do something here when touch release
break;
}
return true;
}
对于动画试试这个 animation-source_code
关于android - Android 上的图像动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30181326/