RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
创新互联React教程:ToastAndroid

它揭示了如何将本地 ToastAndroid 模块作为一个 JS 模块。它有一个名为 showText 的函数,其拥有的参数如下所示:

成都创新互联公司专业成都做网站、网站设计、外贸营销网站建设,集网站策划、网站设计、网站制作于一体,网站seo、网站优化、网站营销、软文营销等专业人才根据搜索规律编程设计,让网站在运行后,在搜索中有好的表现,专业设计制作为您带来效益的网站!让网站建设为您创造效益。

  1. 字符串消息:将文本传递给 toast 的字符串

  2. int 持续期:toast 的持续期。可能是 ToastAndroid.SHORT 或 ToastAndroid.LONG

方法

static show(message: string, duration: number)

性质

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;


本文名称:创新互联React教程:ToastAndroid
文章网址:http://www.jxjierui.cn/article/dpjhdis.html