-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathApp.js
92 lines (85 loc) · 2.45 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/**
* SplashScreen
* 启动屏
* from:http://www.devio.org
* Author:CrazyCodeBoy
* GitHub:https://github.com/crazycodeboy
* Email:[email protected]
* @flow
*/
'use strict';
import React, {Component} from 'react';
import {
StyleSheet,
View,
Text,
TouchableOpacity,
Linking,
Button,
Platform,
} from 'react-native'
import SplashScreen from 'react-native-splash-screen'
export default class example extends Component {
componentDidMount() {
SplashScreen.hide();
}
render() {
return (
<View style={styles.container}>
<TouchableOpacity
onPress={(e)=> {
Linking.openURL('https://coding.imooc.com/class/304.html');
}}
>
<View >
<Text style={styles.item}>
SplashScreen 启动屏
</Text>
<Text style={styles.item}>
@:http://www.devio.org/
</Text>
<Text style={styles.item}>
GitHub:https://github.com/crazycodeboy
</Text>
<Text style={styles.item}>
Email:[email protected]
</Text>
</View>
</TouchableOpacity>
{
// Show splash screen again on Windows and Android, for 3s.
(Platform.OS === 'windows' || Platform.OS === 'android') &&
<View style={styles.showSplashButtonView}>
<Button
title={"Show splash screen again"}
testID={"ShowSplashScreenButton"}
onPress={()=> {SplashScreen.show(); setTimeout(()=> SplashScreen.hide(), 3000)}}
/>
</View>
}
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f3f2f2',
paddingTop: 30,
paddingBottom: 30,
paddingLeft: 30,
paddingRight: 30,
},
item: {
fontSize: 20,
},
line: {
flex: 1,
height: 0.3,
backgroundColor: 'darkgray',
},
showSplashButtonView: {
marginTop:30,
alignSelf: 'baseline',
}
})