mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Open source Modal
Summary: This open sources an internal Modal View Reviewed By: mkonicek Differential Revision: D3065229 fb-gh-sync-id: 763996aef375883d94f70e617bfc7835a9cecb6f shipit-source-id: 763996aef375883d94f70e617bfc7835a9cecb6f
This commit is contained in:
committed by
Facebook Github Bot 2
parent
c76523f1ad
commit
db7a154360
@@ -19,7 +19,7 @@ var React = require('react-native');
|
||||
var {
|
||||
Modal,
|
||||
StyleSheet,
|
||||
SwitchIOS,
|
||||
Switch,
|
||||
Text,
|
||||
TouchableHighlight,
|
||||
View,
|
||||
@@ -96,7 +96,9 @@ var ModalExample = React.createClass({
|
||||
<Modal
|
||||
animated={this.state.animated}
|
||||
transparent={this.state.transparent}
|
||||
visible={this.state.modalVisible}>
|
||||
visible={this.state.modalVisible}
|
||||
onRequestClose={() => {this._setModalVisible(false)}}
|
||||
>
|
||||
<View style={[styles.container, modalBackgroundStyle]}>
|
||||
<View style={[styles.innerContainer, innerContainerTransparentStyle]}>
|
||||
<Text>This modal was presented {this.state.animated ? 'with' : 'without'} animation.</Text>
|
||||
@@ -111,12 +113,12 @@ var ModalExample = React.createClass({
|
||||
|
||||
<View style={styles.row}>
|
||||
<Text style={styles.rowTitle}>Animated</Text>
|
||||
<SwitchIOS value={this.state.animated} onValueChange={this._toggleAnimated} />
|
||||
<Switch value={this.state.animated} onValueChange={this._toggleAnimated} />
|
||||
</View>
|
||||
|
||||
<View style={styles.row}>
|
||||
<Text style={styles.rowTitle}>Transparent</Text>
|
||||
<SwitchIOS value={this.state.transparent} onValueChange={this._toggleTransparent} />
|
||||
<Switch value={this.state.transparent} onValueChange={this._toggleTransparent} />
|
||||
</View>
|
||||
|
||||
<Button onPress={this._setModalVisible.bind(this, true)}>
|
||||
|
||||
Reference in New Issue
Block a user