O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an action sheet

The two methods that ActionSheetIOS makes available are showActionSheetWithOptions and showShareActionSheetWithOptions.

The first method, showActionSheetWithOptions, accepts two arguments: an options object and a callback function.

The options object must contain at least one of the following properties. We use all five in this example:

  • options: This is an array of strings that map to the multiple options that appear in the overlay.
  • cancelButtonIndex: This is a number that points to the index where the Cancel button, if it exists, is located in the options array. This sends the Cancel button to the very bottom of the overlay.
  • destructiveButtonIndex: This is a number that points to the index where a destructive button, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required