question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad Android Scrolling Performance

See original GitHub issue

Describe the bug When we have a high amount of images displayed in a ScrollVIew or FlatList, scrolling does not really work when we use FastImage on Android. The same code works very well on iOS Devices.

To Reproduce I tested this example code in a plain react-native app and the same behavior was recognized:

import { FlatList, View, ScrollView } from 'react-native'
import FastImage from 'react-native-fast-image'
const data = Array(100).fill(1)

const App = () => {
    return (
        <View style={{ flex: 1 }}>
            <ScrollView style={{ backgroundColor: '#000' }}>
                {data.map((element, index) => {
                    return (
                        <FastImage
                            onError={() => console.log('error', index)}
                            source={{ uri: `https://picsum.photos/id/${index}/450/253` }}
                            style={{ width: '100%', aspectRatio: 16 / 9 }}
                        />
                    )
                })}
            </ScrollView>
        </View>
    )
}

Expected behavior Smooth scrolling also on android devices

Dependency versions

  • React Native version: 0.61.4
  • React version: 16.11.0
  • React Native Fast Image version: 7.0.2

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:8

github_iconTop GitHub Comments

4reactions
hjhimanshu01commented, May 3, 2020

@klaaz0r , did u made it working with scrollView? UPDATE: made it working using removeClippedSubviews={true} for ScrollView

1reaction
yaronlevicommented, Dec 17, 2019

Same here RN@0.61.5 Many horizontal Flatlists and on Android it sluggish and feels slow. On iOS, it works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android RecyclerView Scrolling Performance - Stack Overflow
The problem is the poor scrolling performance. This in a RecycleView with only 8 items. In some tests I verified that in Android...
Read more >
How to fix Android Phone scrolling problem-Carlcare
Here are the simple solutions to fix Android phone scrolling problem by yourself! You can try to update system, turn off developer options ......
Read more >
Android faces a performance crisis that only Google can fix
According to Poole, “The vast majority of people's time on a phone is scrolling through webpages, scrolling through Facebook, or something like ...
Read more >
Really bad scrolling/UI lag after Android 12 update - Reddit
TO TRY THIS, GO TO AN APP KNOWN TO HAVE BAD STUTTERING, USING BOTH HANDS, KEEP ONE FINGER ON THE SCREEN AT ALL...
Read more >
How to Improve RecyclerView Scrolling Performance in ...
How to Improve RecyclerView Scrolling Performance in Android? · 1. Set a specific width and height to ImageView in RecyclerView items · 2....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found