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

weixin_38080704 weixin_38080704 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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
...全文

相关推荐

评论
收藏 已收藏
分享
返回顶部