[Android] not all images are shown
See original GitHub issueHey guys,
Description
I’ve created sample app, that should show 100 images. Actual: App randomly shows around 50% of the images. example1, example2 Expected: All 100 images should be shown.
Reproduction Steps and Sample Code
Download the app where the issues reproduces: rnapp.zip
Repro steps:
- Perform
react-native init rnapp
command. - Add 100 images in the
./images
folder - Change
index.android.js
file like this:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Image,
View
} from 'react-native';
export default class rnapp extends Component {
render() {
return (
<View style={styles.container}>
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
<Image style={styles.image} resizeMode={Image.resizeMode.contain} source={require("./images/laptop_phone_howitworks.1.png")}/>
...
<Image style={styles.image} resizeMode={Image.resizeMode.contain} source={require("./images/laptop_phone_howitworks.100.png")}/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
image: {
width: 25,
height: 25,
margin: 3,
}
});
AppRegistry.registerComponent('rnapp', () => rnapp);
Additional Information
- React Native version: 0.43.3
- Platform: Android
- Development Operating System: Windows
- Dev tools: Android Studio version 2.3.1, Android SDK version 23
Issue Analytics
- State:
- Created 6 years ago
- Reactions:13
- Comments:25 (1 by maintainers)
Top Results From Across the Web
Why Can't I See My Pictures in My Gallery? [Causes & Fixes]
Part 2: What If Android Gallery Doesn't Show Pictures? (11 Tricks) · Trick 1: Ensure you didn't close the camera immediately after snapping ......
Read more >Gallery not showing images on Android? Here's How to Fix it
How to Fix “Gallery Not Showing Images” Issue on Android · Download & install both ES File Explorer and Media Rescan apps on...
Read more >Pictures and videos not showing in the gallery
Solution 1 · Go to File manager -> Android -> Data -> com.android. · Delete the folder ( com.android. · Go to Settings...
Read more >How To Fix Google Photos Not Showing All Photos On Android
The first thing we recommend you should do to fix Google Photos not showing all photos on Android is to erase the app...
Read more >How to Fix Android Gallery not Showing Pictures - Techilife
Further | android gallery not showing pictures · Enable Media visibility for individual users on Android as well. · Turn on specific user...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @nihgwu, thanks for the clarification. Do I get it right that the root cause of this issues is a memory problem? As of now, I’ve found a workaround that fixes the issue: add
android:largeHeap="true"
toAndroidManifest.xml
Application section.For me, https://github.com/facebook/react-native/issues/10569 worked very well. I’m using ScrollViews and setting
removeClippedSubviews={true}
solved my issue.