【问题标题】:ImageView widget rotatorImageView 小部件旋转器
【发布时间】:2013-04-12 10:04:45
【问题描述】:

我正在开发一个循环显示一些图像的 android 小部件应用程序。此小部件模拟网站图像横幅旋转器。

我正在使用 ScheduledExecutorService 执行将当前图像更改为下一个图像的任务。

所有图像应每 2 或 3 秒更改一次,但 Android 似乎不喜欢这种在几分钟内停止任务的行为。

我尝试使用动画 gif,但它显示为静态图像。

谁能给我任何想法?

谢谢。

【问题讨论】:

    标签: android rotation widget imageview banner


    【解决方案1】:

    对于使用 gif,您可以使用 WebView 或 Movie 类(如本教程中的说明)。

    http://weavora.com/blog/2012/02/07/android-how-to-use-animated-gif/

    要制作横幅旋转器,请访问此链接android ad banner

    【讨论】:

      【解决方案2】:

      解决方案是使用android 的Alarm Manager 机制而不是ScheduledExecutorService。感谢您的回复。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多