forked from alwx/react-native-photo-view
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhotoView.ios.js
31 lines (26 loc) · 960 Bytes
/
PhotoView.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
import React, {Component} from 'react';
import {
View,
ScrollView,
Image,
TouchableWithoutFeedback
} from 'react-native';
export default class PhotoView extends Component {
render() {
return (
<ScrollView
contentContainerStyle={{ alignItems:'center', justifyContent:'center' }}
centerContent={true}
maximumZoomScale={this.props.maximumZoomScale}
minimumZoomScale={this.props.minimumZoomScale}
showsHorizontalScrollIndicator={this.props.showsHorizontalScrollIndicator}
showsVerticalScrollIndicator={this.props.showsVerticalScrollIndicator}
>
<TouchableWithoutFeedback
onPress={this.props.onTap ? this.props.onTap : function() {}}>
<Image {...this.props}/>
</TouchableWithoutFeedback>
</ScrollView>
);
}
}