import Swiper from 'react-native-swiper';
<View style={styles.container}>
{
this.state.data&&this.state.data.length>0?<Swiper
horizontal={true}
loop={true}
autoplay={true}
height={100}
showsPagination={true}
// paginationStyle={{bottom: 10}}
removeClippedSubviews={true}
showsButtons={false}
autoplayTimeout={0.8}
dot={<View style={styles.banenr_dot}></View>}
activeDot={<View style={styles.active_dot}></View>}
>
{this.state.data.map((v,i)=>{
return <View style={styles.two_line} key={i}>
{v.itemList.map((item,index)=>{
return <Image key={index} style={styles.small_icon} source={{uri:item.url}}></Image>
})}
</View>
})}
</Swiper>:null
}
</View>
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#FFFFFF',
},
banenr_dot: {
// width:5,
// height:3,
// backgroundColor:'#2378FF',
// borderRadius:4,
// marginLeft:2.5,
// marginRight:2.5,
// opacity:0.6
},
active_dot:{
// width:8,
// height:3,
// backgroundColor:'#3F81EA',
// borderRadius:10,
// marginLeft:2.5,
// marginRight:2.5
},
two_line: {
width:'90%',
marginLeft:'5%',
flexDirection: "row",
justifyContent: "space-around",
marginTop: 22,
marginTop:100,
},
small_icon:{
width:69,
height:69
}
});
react-native-swiper 实现轮播图
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...