-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.ios.js
96 lines (88 loc) · 2.08 KB
/
index.ios.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
93
94
95
96
/**
* Created by TinySymphony on 2017-03-23.
*/
import React, {Component} from 'react';
import {
StyleSheet,
AppRegistry,
View,
Text,
Easing,
ScrollView,
TouchableHighlight
} from 'react-native';
import ZoomImage from './ZoomImage';
export default class ZoomImageExample extends Component {
constructor(props) {
super(props);
this.text = '';
this.state = {
enable: true
};
}
render() {
return (
<ScrollView>
<View style={styles.content}>
<Text style={styles.txt}>Zoom Image Examples! Try to click them~</Text>
<View style={styles.imgItem}>
<ZoomImage
source={{uri: 'https://avatars2.githubusercontent.com/u/7685233?v=3&s=460'}}
imgStyle={{width: 220, height: 220}}
style={styles.img}
disabled={!this.state.enable}
/>
</View>
<View style={styles.imgItem}>
<ZoomImage
source={{uri: 'https://ooo.0o0.ooo/2017/03/31/58de0e9b287f6.jpg'}}
imgStyle={{width: 250, height: 230}}
style={styles.img}
enableScaling={true}
/>
</View>
<View style={styles.imgItem}>
<ZoomImage
source={{uri: 'https://ooo.0o0.ooo/2017/03/31/58de0e9b28328.jpg'}}
imgStyle={{width: 250, height: 240}}
style={styles.img}
easingFunc={Easing.bounce}
/>
</View>
</View>
</ScrollView>
);
}
}
const styles = StyleSheet.create({
content: {
justifyContent: 'center',
alignItems: 'center'
},
txt: {
fontSize: 16,
marginTop: 50,
color: '#333'
},
img: {
borderWidth: 3,
borderColor: '#45b7d5'
},
imgItem: {
justifyContent: 'center',
alignItems: 'center',
margin: 20
},
btn: {
marginTop: 10,
padding: 10,
overflow: 'hidden',
borderRadius: 5,
backgroundColor: '#37b9d5'
},
btnText: {
fontSize: 14,
color: '#f0f0f0'
}
});
AppRegistry.registerComponent('zImage', () => ZoomImageExample)