iOS 风格的滑动操作按钮(位于组件后方)
此功能不再受支持,请考虑改用 https://github.com/software-mansion/react-native-gesture-handler。
iOS 风格的滑动操作按钮,从组件后方出现
npm install --save react-native-swipeout更详细的示例请参阅 example/index.ios.js。 使用技巧请参阅 Wiki。 若要在 iOS 风格列表项后方使用滑动操作,请尝试 React-native-listitem。
import Swipeout from 'react-native-swipeout';
// Buttons
var swipeoutBtns = [
{
text: 'Button'
}
]
// Swipeout component
<Swipeout right={swipeoutBtns}>
<View>
<Text>Swipe me left</Text>
</View>
</Swipeout>
| Prop | 类型 | 可选 | 默认值 | 描述 |
|---|---|---|---|---|
| autoClose | bool | 是 | false | 按下按钮时自动关闭 |
| backgroundColor | string | 是 | '#dbddde' | |
| close | bool | 是 | 关闭滑动操作 | |
| disabled | bool | 是 | false | 是否禁用滑动操作 |
| left | array | 是 | [] | 左侧滑动按钮 |
| onOpen | func | 是 | (sectionID, rowId, direction: string) => void | |
| onClose | func | 是 | (sectionID, rowId, direction: string) => void | |
| right | array | 是 | [] | 右侧滑动按钮 |
| scroll | func | 是 | 阻止父级滚动 | |
| style | style | 是 | 容器样式 | |
| sensitivity | number | 是 | 50 | 手势灵敏度 |
| buttonWidth | number | 是 | 每个按钮的宽度 |
属性 | 类型 | 可选 | 默认值 | 描述 | ------ | -------- | --------- | ----------- | backgroundColor | string | 是 | '#b6bec0' | 背景颜色 颜色 | 字符串 | 是 | '#ffffff' | 文本颜色 component | ReactNode | 是 | null | 传递 c
暂无开放 Issues,或尚未同步最近议题。