新聞中心
它揭示了如何將本地 ToastAndroid 模塊作為一個(gè) JS 模塊。它有一個(gè)名為 showText 的函數(shù),其擁有的參數(shù)如下所示:

成都創(chuàng)新互聯(lián)公司專業(yè)成都做網(wǎng)站、網(wǎng)站設(shè)計(jì)、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè),集網(wǎng)站策劃、網(wǎng)站設(shè)計(jì)、網(wǎng)站制作于一體,網(wǎng)站seo、網(wǎng)站優(yōu)化、網(wǎng)站營(yíng)銷(xiāo)、軟文營(yíng)銷(xiāo)等專業(yè)人才根據(jù)搜索規(guī)律編程設(shè)計(jì),讓網(wǎng)站在運(yùn)行后,在搜索中有好的表現(xiàn),專業(yè)設(shè)計(jì)制作為您帶來(lái)效益的網(wǎng)站!讓網(wǎng)站建設(shè)為您創(chuàng)造效益。
-
字符串消息:將文本傳遞給 toast 的字符串
-
int 持續(xù)期:toast 的持續(xù)期??赡苁?nbsp;
ToastAndroid.SHORT或ToastAndroid.LONG
方法
static show(message: string, duration: number)
性質(zhì)
SHORT: MemberExpression
LONG: MemberExpression
示例
'use strict';
var React = require('react-native');
var {
StyleSheet,
Text,
ToastAndroid,
TouchableWithoutFeedback
} = React;
var UIExplorerBlock = require('UIExplorerBlock');
var UIExplorerPage = require('UIExplorerPage');
var ToastExample = React.createClass({
statics: {
title: 'Toast Example',
description: 'Toast Example',
},
getInitialState: function() { return {};
},
render: function() { return (
ToastAndroid.show('This is a toast with short duration', ToastAndroid.SHORT)}>
Click me.
ToastAndroid.show('This is a toast with long duration', ToastAndroid.LONG)}>
Click me too.
);
},
});
var styles = StyleSheet.create({
text: {
color: 'black',
},
});
module.exports = ToastExample;
文章題目:創(chuàng)新互聯(lián)React教程:ToastAndroid
網(wǎng)站地址:http://m.5511xx.com/article/dpjhdis.html


咨詢
建站咨詢
