【问题标题】:Images slowing down application图像减慢应用程序
【发布时间】:2021-11-06 23:41:56
【问题描述】:

在我的应用程序中,我有 sqlite 数据库,它存储图像的路径,这些图像稍后在 tablayout 的不同选项卡中显示为 recyclerview 中的项目。例如,在标签蔬菜中有蔬菜等的图像。此图像严重减慢应用程序的速度,选项卡加载 5-10 秒有时会崩溃。我尝试将图像更改为 nodpi,它有所帮助但没有多大帮助。如果我使用矢量图像,它可以完美地工作。我能做什么?

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: android-studio optimization android-recyclerview image-scaling


【解决方案1】:

所以我的问题是通过函数 image.background = 使用未格式化的图像,我已将其更改为 image.setImageUri 并让 android studio 对我的图像进行 mipmaps。

【讨论】:

    猜你喜欢
    • 2012-12-25
    • 1970-01-01
    • 2011-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多