-
Notifications
You must be signed in to change notification settings - Fork 7
/
objc-implementation.js
85 lines (81 loc) · 1.9 KB
/
objc-implementation.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
import React, { Component } from 'react';
import { Image, Dimensions, Text, StyleSheet, View } from 'react-native';
import { RNCubeTransition } from 'react-native-cube-transition';
const { width, height } = Dimensions.get('window');
const images = [
`https://unsplash.it/${width}/${height}?random&1`,
`https://unsplash.it/${width}/${height}?random&2`,
`https://unsplash.it/${width}/${height}?random&3`,
]
export default class CubeTransitionExample extends Component {
render() {
return (
<View style={styles.container}>
<RNCubeTransition style={styles.page}>
<Image
source={require('./assets/1.jpg')}
style={styles.image}
/>
<Image
source={require('./assets/2.jpg')}
style={styles.image}
key="2"
/>
<Image
source={require('./assets/3.jpg')}
style={styles.image}
key="3"
/>
<Image
source={require('./assets/4.jpg')}
style={styles.image}
key="4"
/>
<Image
source={require('./assets/5.jpg')}
style={styles.image}
key="5"
/>
<Image
source={require('./assets/6.jpg')}
style={styles.image}
key="6"
/>
</RNCubeTransition>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
flex: 1,
},
page: {
position: 'absolute',
flexDirection: 'row',
overflow: 'hidden',
top: 0,
bottom: 0,
left: 0,
right: 0,
},
image: {
resizeMode: 'stretch',
width,
height,
},
view: {
justifyContent: 'center',
alignItems: 'center',
width,
height,
},
text: {
color: '#FFF',
textAlign: 'center',
fontSize: 30,
},
});