Edit on GitHub
创新互联是专业的隆化网站建设公司,隆化接单;提供网站建设、网站制作,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行隆化网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!
automaticallyAdjustContentInset 布尔型
contentInset {top: number, left: number, bottom: number, right: number}
html 字符串型
onNavigationStateChange 函数
renderError 函数
renderLoading 函数
shouldInjectAJAXHandler 布尔型
startInLoadingState 布尔型
style View#style
url 字符串型
[Edit on GitHub](Edit on GitHub)
'use strict';var React = require('react-native');var StyleSheet = require('StyleSheet');var { StyleSheet, Text, TextInput, TouchableOpacity, View, WebView } = React;var HEADER = '#3b5998';var BGWASH = 'rgba(255,255,255,0.8)';var DISABLED_WASH = 'rgba(255,255,255,0.25)';var TEXT_INPUT_REF = 'urlInput';var WEBVIEW_REF = 'webview';var DEFAULT_URL = 'https://m.facebook.com';var WebViewExample = React.createClass({ getInitialState: function() { return { url: DEFAULT_URL, status: 'No Page Loaded', backButtonEnabled: false, forwardButtonEnabled: false, loading: true, }; }, inputText: '', handleTextInputChange: function(event) { this.inputText = event.nativeEvent.text; }, render: function() { this.inputText = this.state.url; return (); }, goBack: function() { this.refs[WEBVIEW_REF].goBack(); }, goForward: function() { this.refs[WEBVIEW_REF].goForward(); }, reload: function() { this.refs[WEBVIEW_REF].reload(); }, onNavigationStateChange: function(navState) { this.setState({ backButtonEnabled: navState.canGoBack, forwardButtonEnabled: navState.canGoForward, url: navState.url, status: navState.title, loading: navState.loading, }); }, onSubmitEditing: function(event) { this.pressGoButton(); }, pressGoButton: function() { var url = this.inputText.toLowerCase(); if (url === this.state.url) { this.reload(); } else { this.setState({ url: url, }); } // dismiss keyoard this.refs[TEXT_INPUT_REF].blur(); }, });var styles = StyleSheet.create({ container: { flex: 1, backgroundColor: HEADER, }, addressBarRow: { flexDirection: 'row', padding: 8, }, webView: { backgroundColor: BGWASH, height: 350, }, addressBarTextInput: { backgroundColor: BGWASH, borderColor: 'transparent', borderRadius: 3, borderWidth: 1, height: 24, paddingLeft: 10, paddingTop: 3, paddingBottom: 3, flex: 1, fontSize: 14, }, navButton: { width: 20, padding: 3, marginRight: 3, alignItems: 'center', justifyContent: 'center', backgroundColor: BGWASH, borderColor: 'transparent', borderRadius: 3, }, disabledButton: { width: 20, padding: 3, marginRight: 3, alignItems: 'center', justifyContent: 'center', backgroundColor: DISABLED_WASH, borderColor: 'transparent', borderRadius: 3, }, goButton: { height: 24, padding: 3, marginLeft: 8, alignItems: 'center', backgroundColor: BGWASH, borderColor: 'transparent', borderRadius: 3, alignSelf: 'stretch', }, statusBar: { flexDirection: 'row', alignItems: 'center', paddingLeft: 5, height: 22, }, statusBarText: { color: 'white', fontSize: 13, }, spinner: { width: 20, marginRight: 6, }, }); exports.title = ' {'<'} {'>'} Go! {this.state.status} '; exports.description = 'Base component to display web content'; exports.examples = [ { title: 'WebView', render(): ReactElement { return ; } } ];
标题名称:创新互联React教程:Web 视图
文章来源:http://www.shufengxianlan.com/qtweb/news34/233584.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联