React-Native schema跳转

前端之家收集整理的这篇文章主要介绍了React-Native schema跳转前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_502_1@demo 地址:https://git.oschina.net/tomcode/react-native-schema.git
一,index.android.js内容
var React = require(‘react-native’);
var {
View,
AppRegistry,
} = React;

@H_502_1@var OpenURLButton = require(‘./openurl’);

@H_502_1@var schema = React.createClass({

@H_502_1@render: function() {
return (

https://www.baidu.com‘} />




);
},
});
AppRegistry.registerComponent(‘schema’,() => schema);

@H_502_1@二OpenURLButton button空间内容
‘use strict’;

@H_502_1@var React = require(‘react-native’);
var {
IntentAndroid,
StyleSheet,
Text,
TouchableNativeFeedback,
View,
ToastAndroid,
} = React;

@H_502_1@var OpenURLButton = React.createClass({

@H_502_1@propTypes: {
url: React.PropTypes.string,
},

@H_502_1@handleClick: function() { IntentAndroid.canOpenURL(this.props.url,(supported) => { //判断当前uri是否可以打开 if (supported) { IntentAndroid.openURL(this.props.url); } else { ToastAndroid.show(“不能识别当前uri”,ToastAndroid.SHORT); } }); },//返回当前button组件显示的视图,这里是一个TouchableNativeFeedback render: function() { return (

原文链接:https://www.f2er.com/react/307035.html

猜你在找的React相关文章