【问题标题】:Android Custom Notification with big animated gif image带有大动画 gif 图像的 Android 自定义通知
【发布时间】:2017-08-05 19:54:15
【问题描述】:

我想用大动画 gif 图像制作自定义通知。所以我找不到解决这个问题的解决方案。 因为我只能使用 RemoteView 来定制布局。 Creating custom android notification without RemoteView

但 RemoteView 只支持一些基本视图。
https://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout

我该怎么做?

【问题讨论】:

  • 嗨,您找到解决方案了吗?
  • 你是怎么做到的?我想做一些非常相似的事情。
  • 你能在这里上传你做过的和你需要的吗?

标签: android image notifications gif remoteview


【解决方案1】:

没有很好的解决方案,但你可以使用这个技巧:

您可以将 imageView 设置为通知的 remoteView,然后更改每个 gif 帧的 imageView 的图像并更新您的 remoteView imageView 图像和通知,您应该在单独的线程上执行此操作,因为它很昂贵!

为了将你的 gif 夹在不同的图像上,你可以试试这个解决方案:

拆分你的项目:

https://ezgif.com/split

在项目内部和运行时拆分:

Split GIF into frames

如果此解决方案对您有用,请通知我

【讨论】:

    猜你喜欢
    • 2014-04-04
    • 2019-08-11
    • 2014-11-22
    • 2020-12-29
    • 1970-01-01
    • 2018-06-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多