|
@@ -1,69 +1,69 @@
|
1
|
1
|
const React = require('react');
|
2
|
2
|
const { PureComponent } = require('react');
|
3
|
3
|
|
4
|
|
-const { Text, Button, View, Alert, Platform ,ScrollView} = require('react-native');
|
|
4
|
+const { Text, Button, View, Alert, Platform, ScrollView, StyleSheet } = require('react-native');
|
5
|
5
|
const { Navigation } = require('react-native-navigation');
|
6
|
6
|
|
7
|
7
|
const testIDs = require('../../testIDs');
|
8
|
8
|
|
9
|
9
|
class CustomDialogWithScroll extends PureComponent {
|
10
|
|
- static options() {
|
11
|
|
- return {
|
12
|
|
- statusBarBackgroundColor: 'green'
|
13
|
|
- };
|
14
|
|
- }
|
|
10
|
+ static options() {
|
|
11
|
+ return {
|
|
12
|
+ statusBarBackgroundColor: 'green'
|
|
13
|
+ };
|
|
14
|
+ }
|
15
|
15
|
|
16
|
|
- render() {
|
17
|
|
- return (
|
18
|
|
- <View style={styles.container}>
|
19
|
|
- <ScrollView style={styles.root}>
|
20
|
|
- <View style={{height: 60, backgroundColor: 'red'}}/>
|
21
|
|
- <View style={{height: 60, backgroundColor: 'green'}}/>
|
22
|
|
- <View style={{height: 60, backgroundColor: 'red'}}/>
|
23
|
|
- <View style={{height: 60, backgroundColor: 'green'}}/>
|
24
|
|
- <View style={{height: 60, backgroundColor: 'red'}}/>
|
25
|
|
- <View style={{height: 60, backgroundColor: 'green'}}/>
|
26
|
|
- </ScrollView>
|
27
|
|
- </View>
|
28
|
|
- );
|
29
|
|
- }
|
|
16
|
+ render() {
|
|
17
|
+ return (
|
|
18
|
+ <View style={styles.root}>
|
|
19
|
+ <View style={{ height: 200, width: '80%', alignSelf: 'center', flexDirection: 'row' }}>
|
|
20
|
+ <ScrollView style={styles.scrollView} contentContainerStyle={styles.content}>
|
|
21
|
+ <View style={{ height: 60, backgroundColor: 'red' }} />
|
|
22
|
+ <View style={{ height: 60, backgroundColor: 'green' }} />
|
|
23
|
+ <View style={{ height: 60, backgroundColor: 'red' }} />
|
|
24
|
+ <View style={{ height: 60, backgroundColor: 'green' }} />
|
|
25
|
+ <View style={{ height: 60, backgroundColor: 'red' }} />
|
|
26
|
+ <View style={{ height: 60, backgroundColor: 'green' }} />
|
|
27
|
+ </ScrollView>
|
|
28
|
+ </View>
|
|
29
|
+ </View>
|
|
30
|
+ );
|
|
31
|
+ }
|
30
|
32
|
|
31
|
|
- didDisappear() {
|
32
|
|
- if (Platform.OS === 'android') {
|
33
|
|
- Alert.alert('Overlay disappeared');
|
34
|
|
- }
|
|
33
|
+ didDisappear() {
|
|
34
|
+ if (Platform.OS === 'android') {
|
|
35
|
+ Alert.alert('Overlay disappeared');
|
35
|
36
|
}
|
|
37
|
+ }
|
36
|
38
|
}
|
37
|
39
|
|
38
|
|
-const styles = {
|
39
|
|
- root: {
|
40
|
|
- width: 400,
|
41
|
|
- height: 200,
|
42
|
|
- },
|
43
|
|
- container: {
|
44
|
|
-
|
45
|
|
- width: 400,
|
46
|
|
- height: 200,
|
47
|
|
- flexDirection: 'column',
|
48
|
|
- justifyContent: 'center',
|
49
|
|
- alignItems: 'center',
|
50
|
|
- alignSelf: 'center'
|
51
|
|
- },
|
52
|
|
- h1: {
|
53
|
|
- fontSize: 24,
|
54
|
|
- textAlign: 'center',
|
55
|
|
- margin: 10
|
56
|
|
- },
|
57
|
|
- h2: {
|
58
|
|
- fontSize: 12,
|
59
|
|
- textAlign: 'center',
|
60
|
|
- margin: 10
|
61
|
|
- },
|
62
|
|
- footer: {
|
63
|
|
- fontSize: 10,
|
64
|
|
- color: '#888',
|
65
|
|
- marginTop: 10
|
66
|
|
- }
|
67
|
|
-};
|
|
40
|
+const styles = StyleSheet.create({
|
|
41
|
+ scrollView: {
|
|
42
|
+ backgroundColor: 'blue'
|
|
43
|
+ },
|
|
44
|
+ root: {
|
|
45
|
+ flex: 1,
|
|
46
|
+ flexDirection: 'column',
|
|
47
|
+ justifyContent: 'flex-end'
|
|
48
|
+ },
|
|
49
|
+ content: {
|
|
50
|
+ backgroundColor: 'blue'
|
|
51
|
+ },
|
|
52
|
+ h1: {
|
|
53
|
+ fontSize: 24,
|
|
54
|
+ textAlign: 'center',
|
|
55
|
+ margin: 10
|
|
56
|
+ },
|
|
57
|
+ h2: {
|
|
58
|
+ fontSize: 12,
|
|
59
|
+ textAlign: 'center',
|
|
60
|
+ margin: 10
|
|
61
|
+ },
|
|
62
|
+ footer: {
|
|
63
|
+ fontSize: 10,
|
|
64
|
+ color: '#888',
|
|
65
|
+ marginTop: 10
|
|
66
|
+ }
|
|
67
|
+});
|
68
|
68
|
|
69
|
69
|
module.exports = CustomDialogWithScroll;
|