mirror of
https://github.com/zhigang1992/reactNativeScreenAndroidTouchIssue.git
synced 2026-05-09 13:37:25 +08:00
chore: add react-navigation-fluid-transitions
This commit is contained in:
47
App.js
47
App.js
@@ -7,27 +7,23 @@
|
||||
*/
|
||||
|
||||
import React, {Component} from 'react';
|
||||
import {Platform, StyleSheet, Text, View} from 'react-native';
|
||||
import {Button, Platform, StyleSheet, Text, View} from 'react-native';
|
||||
import {createAppContainer, createStackNavigator} from 'react-navigation';
|
||||
|
||||
const instructions = Platform.select({
|
||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||
android:
|
||||
'Double tap R on your keyboard to reload,\n' +
|
||||
'Shake or press menu button for dev menu',
|
||||
});
|
||||
const PageA = ({navigation}) => (
|
||||
<View style={{flex: 1}}>
|
||||
<Button onPress={() => navigation.push('PageB')} title="Push"/>
|
||||
</View>
|
||||
);
|
||||
|
||||
type Props = {};
|
||||
export default class App extends Component<Props> {
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>Welcome to React Native!</Text>
|
||||
<Text style={styles.instructions}>To get started, edit App.js</Text>
|
||||
<Text style={styles.instructions}>{instructions}</Text>
|
||||
const PageB = () => (
|
||||
<View style={styles.container}>
|
||||
<Button onPress={() => alert("TEST")} title="TEST"/>
|
||||
<View style={StyleSheet.absoluteFill}>
|
||||
<View style={{flex: 1}}/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
</View>
|
||||
);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
@@ -36,14 +32,9 @@ const styles = StyleSheet.create({
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#F5FCFF',
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
});
|
||||
|
||||
export default createAppContainer(createStackNavigator({
|
||||
PageA,
|
||||
PageB
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user