autobots-lib
Version:
汽车人基础库
39 lines (36 loc) • 796 B
JavaScript
;
import {
ToastAndroid,
Platform
} from 'react-native'
import React from 'react-native';
import Toast from 'react-native-root-toast';
const toast = {
Show: function(content) {
if (Platform.OS === 'android') {
ToastAndroid.show('' + content, ToastAndroid.SHORT);
} else {
Toast.show(content, {
position: 0,
shadow: true,
animation: false,
hideOnPress: true,
delay: 0
});
}
},
ShowLong: function(content) {
if (Platform.OS === 'android') {
ToastAndroid.show('' + content, ToastAndroid.LONG);
} else {
Toast.show(content, {
position: 0,
shadow: true,
animation: false,
hideOnPress: true,
delay: 0
});
}
}
};
module.exports = toast;