Android - 使用动画的工件
应用 3D 转换时,我遇到屏幕上的视觉伪影问题 此处。我对此进行了更改,使其绕 x 轴而不是 y 轴旋转。当我进行完整的 180 度旋转(顶部首先远离您)时,我会在应用此操作的每个其他视图的底部区域(底部 10-20%)出现单像素线伪影。我使用选择器作为 LinearLayout 的背景,然后将此动画应用于它。有人能想出一个快速解决这个问题的方法吗?
感谢您的帮助!
I am having a problem with visual artifacts on the screen when applying the 3D transformation found here. I have changed this so it rotates around the x axis instead of the y. When i do a full 180 rotation (top going away from you at first) im getting single pixel line artifacts at the bottom area (bottom 10-20%) of every other view that this is applied to. I am using a selector as the background of a LinearLayout and then applying this Animation to it. Can anyone think of a quick solution to this issue?
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
结果你只需要在每个动画步骤上使父视图无效即可。如果您有自定义动画对象,您可以在 Animation.applyTransformation(...) 内执行此操作
Turns out you just have to invalidate the parent view on each animation step. If you have a custom Animation object you can just do this inside Animation.applyTransformation(...)
我在 2D 动画中遇到了类似的问题,其中视图移出屏幕(在父视图之外)。我的解决方案非常简单。在我的自定义视图中,我只是使父视图无效,以便在每一帧重新绘制它。
I had a similiar problem with a 2D animation where a View is moved off screen (outside parent view). My solution was quite simple. In my custom View I simply invalidate the parent view to have it redrawn at every frame.