1.0.6 • Published 7 years ago

react-native-dj-toastwithicon v1.0.6

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

Toast

accordion

Install

npm i --save react-native-dj-toastwithicon

Usage

Using in your app will usually look like this:

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TouchableHighlight,
} from 'react-native';

import Toast from 'react-native-dj-toast';


export default class NPMTest extends Component {

    render() {
      return (
        <View style={{marginTop:20}}>
          <TouchableHighlight onPress={()=>this.refs.toast.show('This is a toast!')}>
            <Text>click me</Text>
          </TouchableHighlight>
          <Toast ref="toast" />
        </View>
      );
    }
}

AppRegistry.registerComponent('xxx', () => NPMTest);

Props

The following props can be used to modify the style and/or behaviour:

PropTypeOpt/RequiredDefaultNote
iconsarrayOption[]需要显示的icon,可以传多个icon,形式如 require('image!success_black'),require('image!error_black')

Methods

The following methods can be used to open and close the Dialog:

MethodParametersNote
showmessage:需要显示的信息,time:toast显示的时长,默认为2000ms,iconIdx:需要显示的icon在icons数组中的位置iconIdx可不传,默认为0
1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago