强大的RN滑动组件 – react-native-swipeable

weixin_38080704 2019-09-12 02:03:04
React Native Swipeable 一个强大的React Native滑动组件. 支持iOS 和 Android。 安装 npm i --save react-native-swipeable 使用方法 使用Swipeable组件封装你的ListView/TableView 条目。 import Swipeable from 'react-native-swipeable'; const leftContent = <Text>Pull to activate</Text>; const rightButtons = [ <TouchableHighlight><Text>Button 1</Text></TouchableHighlight>, <TouchableHighlight><Text>Button 2</Text></TouchableHighlight> ]; function MyListItem() { return ( <Swipeable leftContent={leftContent} rightButtons={rightButtons}> <Text>My swipeable content</Text> </Swipeable> ); } Props prop type default description children renderable null 可滑动内容 leftContent renderable null ( 可选 ) 拉伸过程中可见的左侧内容 rightContent renderable null ( 可选 )  拉伸过程中可见的右侧内容 leftButtons renderable[] null ( 可选 ) 按钮数组,第一个是最隐秘的;忽视ifleftContentpresent rightButtons renderable[] null ( 可选 )  按钮数组,第一个是最隐秘的;忽视 ifrightContentpresent leftActionActivationDistance integer 125 ( 可选 ) 激活左侧动作的最小刷卡距离 onLeftActionRelease function null ( 可选 ) 用户滑动超过leftActionActivationDistance时发布 rightActionActivationDistance integer 125 ( 可选 )  激活右侧动作的最小刷卡距离 onRightActionRelease function null ( 可选 )   用户滑动超过 rightActionActivationDistance时发布 示例 运行示例需要: npm run build cd example npm install react-native run-ios # or run-android
...全文
309 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧