Android图像旋转不适用于冰淇淋三明治(Android Image Rotation Not Working in Ice Cream Sandwich)

编程入门 行业动态 更新时间:2024-10-26 22:30:46
Android图像旋转不适用于冰淇淋三明治(Android Image Rotation Not Working in Ice Cream Sandwich)

我有一个图像被设置为在我的应用程序中旋转。 除了最新的冰淇淋三明治之外,该代码完美适用于所有Android版本。 图像仍然旋转,但不是从图像的中心轴旋转。 相反,它似乎从图像的左角(0,0)旋转。 有没有人有任何想法,为什么这不适用于冰淇淋三明治? 这是我的代码:

rotator.xml:

<rotate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1200" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:repeatCount="infinite" android:toDegrees="360" />

animation.java:

status.setImageResource(R.drawable.pending); status.startAnimation(AnimationUtils.loadAnimation(_context, R.anim.rotator));

谢谢!

I have an image that is set to rotate in my application. The code works perfectly on all Android versions except for the latest Ice Cream Sandwich. The image still rotates, but it is not rotating from the center axis of the image. Instead, it seems to rotate from the left corner (0,0) of the image. Does anyone have any ideas as to why this does not work in Ice Cream Sandwich? Here is my code:

rotator.xml:

<rotate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1200" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:repeatCount="infinite" android:toDegrees="360" />

animation.java:

status.setImageResource(R.drawable.pending); status.startAnimation(AnimationUtils.loadAnimation(_context, R.anim.rotator));

Thanks!

最满意答案

看来,这个问题的答案Android吐司通知太小冰淇淋三明治也解决了我的微调问题。

It seems that the answer to this question Android Toast notification is too small in Ice Cream Sandwich also solved my spinner problem.

更多推荐

本文发布于:2023-07-22 12:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219905.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:明治   冰淇淋   图像   不适用于   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!