Reputation: 133
App.js
import { StyleSheet, Text, View } from 'react-native'
import React from 'react'
import { FlatListSlider } from 'react-native-flatlist-slider';
const images = [
{
image: 'https://cdn-icons-png.flaticon.com/256/4481/4481273.png',
desc: 'Silent Waters in the mountains in midst of Himilayas',
},
{
image: 'https://cdn-icons-png.flaticon.com/256/4961/4961556.png',
desc:
'Red fort in India New Delhi is a magnificient masterpeiece of humans',
},
{
image: 'https://cdn-icons-png.flaticon.com/256/4481/4481273.png',
desc: 'Silent Waters in the mountains in midst of Himilayas',
},
{
image: 'https://cdn-icons-png.flaticon.com/256/4961/4961556.png',
desc:
'Red fort in India New Delhi is a magnificient masterpeiece of humans',
},
]
const IncomeReceive = () => {
return (
<View style={{ flex: 1 }}>
<FlatListSlider
data={images}
width={200}
timer={5000}
onPress={item => alert(JSON.stringify(item))}
indicatorActiveWidth={20}
contentContainerStyle={{ paddingHorizontal: 16 }}
/>
</View>
)
}
export default IncomeReceive
const styles = StyleSheet.create({})
Output:
My images display on the tablet, but when I display them on another device, they don't show. I don't know where my mistake is. I'm using react-native-flatlist-slider
.
I've seen one video on this library, but in the video, the images are showing.
Can anyone help me?
Upvotes: 1
Views: 386
Reputation: 297
**work for me**
<View style={{ flex: 1 }}>
<FlatListSlider
data={images}
width={200}
height={200} <--- Add this
timer={5000}
onPress={item => alert(JSON.stringify(item))}
indicatorActiveWidth={20}
contentContainerStyle={{ paddingHorizontal: 16 }}
/>
</View>
Upvotes: 1