Actionsheetios Method
Static Showactionsheetwithoptions (Options:object, callback:function): Display Pull Menu
Static Showshareactionsheetwithoptions (Options:object, Failurecallback:function, successcallback:function): Display Share Menu instance
' Use strict ';
var react = require (' react-native ');
var {actionsheetios, StyleSheet, Text, View,} = react;
var BUTTONS = [' button index:0 ', ' button index:1 ', ' button index:2 ', ' destruct ', ' Cancel ',];
var destructive_index = 3;
var cancel_index = 4;
var actionsheetexample = React.createclass ({getinitialstate () {return {clicked: ' None ',};
}, Render () {return (<View> <text Onpress={this.showactionsheet} style={style.button}> Click to show the Actionsheet </Text> <Text> clicked button at index: "{th
is.state.clicked} "</Text> </View>); }, Showactionsheet () {actionsheetios.showactionsheetwithoptions ({options:buttons, Cancelbuttonindex: Cancel_index, Destructivebuttonindex:destructive_index,}, (Buttonindex) => {this.setstate ({CLI
Cked:buttons[buttonindex]});
});
}
}); var SHareactionsheetexample = React.createclass ({getinitialstate () {return {text: '}; }, Render () {return (<View> <text onpress={this.showshareactionsheet} Style={style.button}
> Click to show the Share actionsheet </Text> <Text> {this.state.text}
</Text> </View>); }, Showshareactionsheet () {actionsheetios.showshareactionsheetwithoptions ({url: ' https://code.facebook.com ')
,}, (Error) => {console.error (error);
}, (Success, method) => {var text;
if (success) {text = ' Shared via ${method} ';
else {text = ' you didn\ ' t share ';
} this.setstate ({text})});
}
});
var style = stylesheet.create ({button: {marginbottom:10, fontweight: ' 500 ',}});
Exports.title = ' Actionsheetios ';
Exports.description = ' Interface to show ios\ ' action sheets '; Exports.exAmples = [{title: ' Show Action Sheet ', Render (): reactelement {return <actionsheetexample/>;}
}, {title: ' Show Share Action Sheet ', Render (): reactelement {return <shareactionsheetexample/>;} }
];
effect
Pull up menu
Share Menu