Created
January 20, 2017 16:21
-
-
Save Lxxyx/3043b1120943c6abe93914727d4323a7 to your computer and use it in GitHub Desktop.
RN点击时,只有最里面会收到通知。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
TouchableWithoutFeedback | |
} from 'react-native'; | |
export default class touchTest extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<TouchableWithoutFeedback onPress={() => console.log('Other TouchableWithoutFeedback')}> | |
<TouchableWithoutFeedback onPress={() => console.log('Inner TouchableWithoutFeedback')}> | |
<View style={{ | |
height: 100, | |
width: 100, | |
borderColor: 'blue', | |
borderWidth: 1 | |
}}></View> | |
</TouchableWithoutFeedback> | |
</TouchableWithoutFeedback> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF', | |
} | |
}); | |
AppRegistry.registerComponent('touchTest', () => touchTest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment