ReactNative - Android 在可能的图像视图中非常慢 [英] ReactNative - Android extremely slow within may image views

查看:69
本文介绍了ReactNative - Android 在可能的图像视图中非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现一个包含大量图像视图的主屏幕.这个概念就像 Photoshop 图层.每层都是一个图像视图 (PNG).屏幕包含 20-30 个图像.资产存储在本地.

I'm implementing a Home screen that have lots of image views. The concept is like Photoshop layers. Each layer is an image view (PNG). The screen contains 20-30 images. The assets are stored locally.

该应用在 iOS 上运行流畅,但在 Android 上运行速度极慢.我的第一个解决方案是减小文件大小,但没有多大帮助.

The app runs smoothly on iOS but it is extremely slow in Android. My first solution is reducing the file sizes but it doesn't help much.

感谢您提供的任何帮助!

Thank you for any help you can offer!

react-native 版本是 0.59.10.

react-native versions is 0.59.10.

推荐答案

use react-native-fast-image

use react-native-fast-image

https://github.com/DylanVann/react-native-fast-image

使用 webp 格式而不是 png

use webp format instead of png

将您的图片放在 android 或 ios 应用程序包中

put your images at android or ios app package

android/app/src/main/res/drawable

这篇关于ReactNative - Android 在可能的图像视图中非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆