React-Native学习--轮播图第三方组件-react-native-swiper
2023-09-27 14:29:03 时间
一.通过npm安装React-native-swiper
1.Basic
Prop | Default | Type | Description |
---|---|---|---|
horizontal | true | bool | 如果值为true时,那么滚动的内容将是横向排列的,而不是垂直于列中的。 |
loop | true | bool | 如果设置为false,那么滑动到最后一张时,再次滑动将不会展示第一张图片。 |
index | 0 | number | 初始进入的页面标识为0的页面。 |
showsButtons | false | bool | 如果设置为true,那么就可以使控制按钮(即:左右两侧的箭头)可见。 |
autoplay | false | bool | 设置为true,则页面可以自动跳转。 |
2.Custom basic style & content
Prop | Default | Type | Description |
---|---|---|---|
width | - | number | 如果你没有特殊的设置,就通过flex:1默认为全屏。 |
height | - | number | 如果你没有特殊的设置,就通过flex:1默认为全屏。 |
style | {...} | style | 设置页面的样式。 |
3.Pagination
Prop | Default | Type | Description |
---|---|---|---|
showsPagination | true | bool | 默认值为true,在页面下边显示圆点,以标明当前页面位于第几个。 |
paginationStyle | {...} | style | 设置页面原点的样式,自定义的样式会和默认样式进行合并。 |
renderPagination | |||
dot | <View style={{backgroundColor:'rgba(0,0,0,.2)', width: 8, height: 8,borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3,}} /> | element | 可以自定义不是当前圆点的样式 |
activeDot | <View style={{backgroundColor: '#007aff', width: 8, height: 8, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3,}} /> | element | 可以自定义当前页面圆点的样式 |
4.Autoplay
Prop | Default | Type | Description |
---|---|---|---|
autoplay | true | bool | 设置为true可以使页面自动滑动。 |
autoplayTimeout | 2.5 | number | 设置每个页面自动滑动停留的时间 |
autoplayDirection | true | bool | 圆点的方向允许默认自己控制 |
5.Control buttons
Prop | Default | Type | Description |
---|---|---|---|
showsButtons | true | bool | 是否显示控制箭头按钮 |
buttonWrapperStyle | {position: 'absolute', paddingHorizontal: 15, paddingVertical: 30, top: 70, left: 0, alignItems:'flex-start'} | style | 定义默认箭头按钮的样式 |
nextButton | <Text style={{fontSize:60, color:'#00a7ec', paddingTop:30, paddingBottom:30}}>‹</Text> | element | 自定义右箭头按钮样式 |
prevButton | <Text style={{fontSize:60, color:'#00a7ec', paddingTop:30, paddingBottom:30}}>›</Text> | element | 自定义左箭头按钮样式 |
相关文章
- ReactJS实战之组件和Props详解
- 前台组件
- vue兄弟组件的传值eventbus
- 【深入学习linux】CentOS 7 最小化安装后程序必须安装的组件
- RT-THREAD组件学习之PM
- Twaver-HTML5基础学习(39)鹰眼可视化视图组件(OverView)
- Vue学习笔记之vue-cli脚手架项目中组件的使用
- Angular 学习笔记 (动态组件 & Material Overlay & Dialog 分析)
- Asp.net core 学习笔记 ( ViewComponent 组件 )
- Netty学习之核心组件(AbstractBootstrap、Bootstrap、ServerBootstrap)
- Netty学习之核心组件(EventLoop、EventLoopGroup)
- vue3--学习技术胖笔记----第五波 瞬间移动组件 Teleport
- Vue组件通信之Bus
- 【转】java日志组件介绍(common-logging,log4j,slf4j,logback )
- 第15.12节PyQt(Python+Qt)入门学习:可视化设计界面组件布局详解
- 第15.11节 PyQt(Python+Qt)入门学习:Qt Designer(设计师)组件Property Editor(属性编辑)界面中主窗口QMainWindow类相关属性详解
- layui弹窗组件layer之layer.msg提示框学习
- Snail—UI学习之得到某组件的方法
- Angular学习笔记【如何正确使用第三方组件】
- Vue和React对比学习之组件传值(Vue2 12种、Vue3 9种、React 7种)
- Vue2.0子父组件通信
- React Native指南汇集了各类react-native学习资源、开源App和组件(必须收藏)