小编Tiz*_*000的帖子

Java - .contains的对面(不包含)

我有一个if语句,我想检查变量'inventory'是否包含'bread'但不包含水.

if(inventory.contains("bread"))#<------现在我想在这里放'但不含水'.#旁边.

任何帮助,将不胜感激 :)

java contains

26
推荐指数
2
解决办法
12万
查看次数

下载文件(使用EXPO)—为什么这么难?

我一直在尝试以多种方式将文件下载到本地存储以响应本机,但都无法正常工作。这是我在App.js中的代码,我在其中调用FileSystem.downloadAsync。

import React from 'react';
import { AppRegistry, StyleSheet, Text, View, TouchableHighlight, Image, Linking, PixelRatio, ListView } from 'react-native';
import { createStackNavigator } from 'react-navigation'
import MainScreen from './Components/MainScreen'
import FileSystem from 'react-native-filesystem';

export default class App extends React.Component {

  render() {     
    return (

      FileSystem.downloadAsync(
        'http://techslides.com/demos/sample-videos/small.mp4',
        FileSystem.documentDirectory + 'small.mp4'
      )
        .then(({ uri }) => {
          console.log('Finished downloading to ', uri);
        })
        .catch(error => {
          console.error(error);
        }),

      <AppStackNavigator />
    );
  }
}

const AppStackNavigator = createStackNavigator({
  Main:{
    screen: MainScreen
  }
}) …
Run Code Online (Sandbox Code Playgroud)

download react-native

5
推荐指数
3
解决办法
2911
查看次数

标签 统计

contains ×1

download ×1

java ×1

react-native ×1