RN的轮播图组件

自行安装

js 复制代码
yarn add react-native-swiper

示例代码

js 复制代码
import React, {useRef, useEffect} from 'react';
import {View, Text} from 'react-native';
import Swiper from 'react-native-swiper';

const MySwiper = () => {

  return (
    <Swiper autoplay={true}>
      {/* 设置 autoplay 为 false,关闭自动播放 */}
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
        <Text>Slide 1</Text>
      </View>
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
        <Text>Slide 2</Text>
      </View>
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
        <Text>Slide 3</Text>
      </View>
    </Swiper>
  );
};

export default MySwiper;

效果图

相关推荐
d***9357 小时前
springboot3.X 无法解析parameter参数问题
android·前端·后端
n***84078 小时前
十七:Spring Boot依赖 (2)-- spring-boot-starter-web 依赖详解
前端·spring boot·后端
likuolei12 小时前
XSL-FO 软件
java·开发语言·前端·数据库
正一品程序员12 小时前
vue项目引入GoogleMap API进行网格区域圈选
前端·javascript·vue.js
j***894612 小时前
spring-boot-starter和spring-boot-starter-web的关联
前端
star_111212 小时前
Jenkins+nginx部署前端vue项目
前端·vue.js·jenkins
im_AMBER12 小时前
Canvas架构手记 05 鼠标事件监听 | 原生事件封装 | ctx 结构化对象
前端·笔记·学习·架构
JIngJaneIL12 小时前
农产品电商|基于SprinBoot+vue的农产品电商系统(源码+数据库+文档)
java·前端·数据库·vue.js·spring boot·毕设·农产品电商系统
Tongfront12 小时前
前端通用submit方法
开发语言·前端·javascript·react
可爱又迷人的反派角色“yang”12 小时前
LVS+Keepalived群集
linux·运维·服务器·前端·nginx·lvs