Android 视图翻转闪烁

发布于 2024-09-18 21:08:25 字数 275 浏览 3 评论 0原文

我有一个 ViewFlipper,其中动态添加了多个视图。我重写 onTouchEvent (和 onInterceptTouchEvent)以获得视图上的向下、移动和向上事件,这样我就知道何时向左和向右设置动画。

现在一切工作正常,除了在滑动开始时有一个小闪烁(其他视图之一瞬间显示在顶部)。这仅在第一次滑动完成后发生。

我查看了 Android 上主屏幕应用程序的源代码,这很有帮助,但他们不使用 ViewFlipper,所以有点不同。

有人遇到同样的问题吗?

谢谢!

I have a ViewFlipper with multiple views added dynamically. I override onTouchEvent (and onInterceptTouchEvent) in order to get the down, move and up events on the views, so I know when to animate left and right.

Now everything works fine, except that there is a small flicker (one of the other views is displayed on top for a split second) at the beginning of the swipe. This only happens after the first swipe is done.

I looked at the source code for the Home screen app on Android, which helped a lot, but they don't use the ViewFlipper, so it's a little different.

Did anyone encounter the same problem?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文