reactnative滑动删除

尊重版权,转载请注明出处

本文来自:江清清的技术专栏-翻译组(http://www.lcode.org)

开源项目地址:https://github.com/dancormier/react-native-swipeout

项目介绍

该组件进行封装实现仿照QQ,微信列表的右滑显示删除,置顶等其他功能item的效果。

创建的React Native技术交流4群:458982758,欢迎各位大牛,React Native技术爱好者加入交流!

配置安装

1.1.运行命令进行安装

?
1
npm install --save react-native-swipeout
使用实例

关于更多的使用实例,可以查看example中的代码

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var Swipeout = require( 'react-native-swipeout' )
 
// Buttons
var swipeoutBtns = [
   {
     text: 'Button'
   }
]
 
// Swipeout component
<Swipeout right={swipeoutBtns}>
   <View>
     <Text>Swipe me left</Text>
   </View>
</Swipeout>
运行效果

配置属性
属性名 类型 是否可选 默认值 描述信息
autoClose bool Yes false 按钮点击是否自动关闭
backgroundColor string Yes '#dbddde'  
close bool Yes   关闭滑动拖拽
left array Yes [] 在左侧进行拖拽
onOpen func Yes    
right array Yes [] 在右侧进行拖拽
scroll func Yes   prevent parent scroll
按钮属性
属性 类型 是否可选 默认 描述信息
backgroundColor string Yes '#b6bec0' background color
color string Yes '#ffffff' text color
component string Yes null pass custom component to button
onPress func Yes null function executed onPress
text string Yes 'Click Me' text
type string Yes 'default' default, primary, secondary
underlayColor string Yes null
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值