-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadWebView.js
More file actions
60 lines (52 loc) · 1.21 KB
/
LoadWebView.js
File metadata and controls
60 lines (52 loc) · 1.21 KB
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
'use strict';
var React = require('react-native');
var {
StyleSheet,
Text,
NavigatorIOS,
View,
WebView,
} = React;
var HEADER = '#E0B32B';
var BGWASH = 'rgba(255,255,255,0.8)';
var WEBVIEW_REF = 'webview';
var LoadWebView = React.createClass({
getInitialState: function() {
return {
url: this.props.link.href,
status: 'No Page Loaded',
backButtonEnabled: false,
forwardButtonEnabled: false,
loading: true,
scalesPageToFit: true,
};
},
render: function() {
return (
<View style={[styles.container]}>
<WebView
contentInset={{top:-215,right:0,bottom:0,left:0}}
ref={WEBVIEW_REF}
automaticallyAdjustContentInsets={false}
style={styles.webView}
url={this.state.url}
javaScriptEnabledAndroid={true}
onNavigationStateChange={this.onNavigationStateChange}
startInLoadingState={true}
scalesPageToFit={this.state.scalesPageToFit}/>
</View>
);
},
});
var styles = StyleSheet.create({
container: {
marginTop: 65,
flex: 1,
backgroundColor: HEADER,
},
webView: {
backgroundColor: BGWASH,
height: 350,
}
});
module.exports = LoadWebView