一个适用于 React Native 的优雅的 ActionSheet 组件。
跨平台 ActionSheet。此组件实现了自定义的 ActionSheet,并提供了在不同平台(iOS 和 Android)上绘制 ActionSheet 的相同方式。实际上,为了保持最佳效果,iOS 上仍然使用 ActionSheetIOS。
class Demo extends React.Component { showActionSheet = () => { this.ActionSheet.show() } render() { return ( Open ActionSheet <ActionSheet ref={o => this.ActionSheet = o} title={'Which one do you like ?'} options={['Apple', 'Banana', 'cancel']} cancelButtonIndex={2} destructiveButtonIndex={1} onPress={(index) => { /* do something */ }} /> ) } }
### 直接使用 ActionSheetCustom
这样您就可以自定义选项和标题…
### 如何重新设计样式?
ActionSheet 的样式定义在 [lib/styles.js](https://github.com/beefe/react-native-actionsheet/blob/master/lib/styles.js) 中。我们可以通过 `styles` 属性来覆盖默认样式。请参阅 [示例](https://github.com/beefe/react-native-actionsheet/blob/master/example/app/ExampleB.js#L48)。暂无开放 Issues,或尚未同步最近议题。