Images not loading on Android
See original GitHub issueThe library works perfectly on iOS, but a Swiper of Images on the Android version won’t display its images. The code:
<Swiper showsButtons={false} style={{}} loop={true} height={screenWidth} width={screenWidth}
dot={<View style={{backgroundColor: 'rgba(255,255,255,.7)', width: 5, height: 5, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3}} />}
activeDot={<View style={{backgroundColor: '#49D2FF', width: 8, height: 8, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3}} />}
paginationStyle={{bottom: 10,}} >
{finalPhotos.map((item, key) => {
return (
<Image key={key} style={{flex:1,width:screenWidth,height:screenWidth,}} source={key === 0 ? (item == "none" ? require("./img/missing-pic-icon.png") : {uri:item}) : {uri:item.image}} />
);
})}
</Swiper>
Other details to note: -Once again, there are no issues on iOS -The swiper is contained in a View that’s contained in another Swiper -The finalPhotos array is made before returning the overall render function
Issue Analytics
- State:
- Created 6 years ago
- Reactions:17
- Comments:15
Top Results From Across the Web
How to fix pictures not showing on Google Chrome
How to fix pictures not showing on Google Chrome · Check if the “show images” setting is enabled · Clear browser cache and...
Read more >Fix: Images not loading in Chrome for Android - Mobile Internist
Fix: Images not loading in Chrome for Android · Clear cache from Chrome · Clear browsing data · Disable Beta features · Uninstall...
Read more >Why Can't I See My Pictures in My Gallery? [Causes & Fixes]
Trick 4: Clear the Gallery's cache files · Navigate to your phone's "Settings". · Proceed to "Application Management"/"App" > "Gallery". · Hit " ......
Read more >Android: Why Can't Open Images and How to Fix it - ITIGIC
Close the app and erase the data · Close all apps · Google Play Services · Free up space · Try another gallery...
Read more >7 Ways to Fix Google Chrome Not Loading Images - MakeUseOf
7 Ways to Fix Google Chrome Not Loading Images · 1. Update Google Chrome · 2. Go Incognito · 3. Check Chrome's Site...
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 FreeTop 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
Top GitHub Comments
same in flatlist on Android. but not in flatlist on iOS.
I found a workaround for this bug by following the second answer to this question on StackOverflow: https://stackoverflow.com/questions/30626030/can-you-force-a-react-component-to-rerender-without-calling-setstate
I used setTimeout for 100 milliseconds in the ComponentDidMount function to execute the setState. The solution will refresh the Swiper so that the images appear on Android without having to re-render everything.