gpt4 book ai didi

android - 旋转后ImageView会重置为原始状态吗?

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:57:46 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Android: Animation Position Resets After Complete

我正在使用 RotateAnimation 来旋转 ImageView。代码很简单:

this.button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Animation ani = new RotateAnimation(
0, /* from degree*/
30, /* to degree */
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
ani.setDuration(1000);
imageView.startAnimation(ani);
}
});

你可以看到我想让 imageView 旋转 30 度。

它可以工作,但是当旋转完成后,图像会回到原来的状态,旋转前的相同位置和角度。我想将 ImageView 固定在最后一个动画位置,即想要将图像固定 30 度倾斜。如何解决?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com