百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-swipe-list-view

> 前端框架
开源

一个 React Native ListView 组件,其行可以滑动打开和关闭

2.8K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个 React Native ListView 组件,其行可以滑动打开和关闭

React-native-swipe-list-view

<SwipeListView> 是一个垂直的 FlatList(或 SectionList),其行可以滑动打开和关闭。它处理了预期的原生行为:当列表滚动或另一行被打开时,关闭当前行。

它还导出了 <SwipeRow>,用于单独使用可滑动的行。

完整文档: https://jessesessler.com/react-native-swipe-list-view/>


v4

v4 是对 TypeScript、React-native-gesture-handler v2 和 React-native-reanimated v3 的全面重写——手势和动画现在在 UI 线程上运行。 组件 API 与 v3 在 props 上完全兼容,除了一小部分破坏性变更(新增 peer 依赖、移除无用的 ListView props、更改了 swipeGestureEnded 的 payload 等)。

从 v3 升级? 请阅读 迁移指南。

安装

bash
npm install react-native-swipe-list-view
npm install react-native-gesture-handler react-native-reanimated

React-native-gesture-handler 和 React-native-reanimated 是 peer 依赖(≥2.14.0 和 ≥3.6.0)。安装它们后:

  1. 将 Reanimated Babel 插件(必须位于列表的最后)添加到 babel.config.js:
javascript
   module.exports = {
       presets: ['module:@react-native/babel-preset'],
       plugins: ['react-native-reanimated/plugin'],
   };
  1. 将你的应用根组件包裹在 GestureHandlerRootView 中:
javascript
   import { GestureHandlerRootView } from 'react-native-gesture-handler';

   export default function App() {
       return (
           <GestureHandlerRootView style={{ flex: 1 }}>
               {/* ... */}
           </GestureHandlerRootView>
       );
   }
  1. 重新构建原生应用(两者均为原生模块)。

请参阅官方设置指南,了解 和 reanimated。

要求: React ≥18,React-native ≥0.73。

快速开始


[](https://www.npmjs.com/package/react-native-swipe-list-view) [](https://github.com/jemise111/react-native-swipe-list-view/actions/workflows/ci.yml)
[gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/installation)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptandroidiosjavascriptreact

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架