1.0.4 • Published 5 years ago

react-native-general-actionsheet v1.0.4

Weekly downloads
20
License
MIT
Repository
github
Last release
5 years ago

react-native-general-actionsheet

npm version Build Status

中文说明

This is a general ActionSheet api. You can use ActionSheetIOS in iOS and use a custom view in Android. Or you can use custom view in both iOS and Android.

It only support ActionSheet.showActionSheetWithOptions now.

ScreenShots

Portrait

Landscape

Install

Install by Yarn:

yarn add react-native-general-actionsheet

Install by NPM:

npm install --save react-native-general-actionsheet

Usage

Use the module in file:

import ActionSheet from 'react-native-general-actionsheet';

ActionSheet.showActionSheetWithOptions(options, callback);

Parameters options and callback is same as ActionSheetIOS.

Use ActionSheetIOS

You can change using ActionSheetIOS or not globally:

import ActionSheet from 'react-native-general-actionsheet';

ActionSheet.useActionSheetIOS = true/false;

Customize Style

You can change style of container globally.

import ActionSheet from 'react-native-general-actionsheet';

ActionSheet.Container.defaultProps.xxx = yyy;

It supports following properties:

NameTypeDescription
backgroundColorstringBackground color of whole view
contentBackgroundColorstringBackground color of content view
separatorColorstringSeparator line color
fontSizenumberButton text font size
colorstringButton text color
titleStyleobjectStyle of title text
messageStyleobjectStyle of message text
destructiveButtonStyleobjectStyle of destructive button
cancelButtonStyleobjectStyle of cancel button
touchableUnderlayColorstringUnderlay color of button touch action
supportedOrientationsarraySupported orientations for iOS