Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 使用expo使用react native显示脱机pdf_React Native_Pdf_Expo - Fatal编程技术网

React native 使用expo使用react native显示脱机pdf

React native 使用expo使用react native显示脱机pdf,react-native,pdf,expo,React Native,Pdf,Expo,正如标题所说,我正试图在react native using EXPO上显示一个保存在assets文件夹中的pdf文件,有什么办法吗? 现在我有了一个即时的解决方案,它显示了一个GoogleDrive读取pdf的网络视图,但我想用本地pdf文件离线执行 从“React”导入React; 从“../layouts”导入{Default}; 从“react native WebView”导入{WebView}; 函数Flujograma({route,navigation}){ const{nam

正如标题所说,我正试图在react native using EXPO上显示一个保存在assets文件夹中的pdf文件,有什么办法吗? 现在我有了一个即时的解决方案,它显示了一个GoogleDrive读取pdf的网络视图,但我想用本地pdf文件离线执行

从“React”导入React;
从“../layouts”导入{Default};
从“react native WebView”导入{WebView};
函数Flujograma({route,navigation}){
const{name}=route.params;
返回(
);
}
导出默认Flujograma;

我认为您应该能够使用expo文件系统将uri更改为文件系统uri

import React from 'react';
import { Default } from '../layouts';

import {WebView} from 'react-native-webview';


function Flujograma({ route, navigation }) {

  const { name } = route.params;

  return (
    <WebView
      source={{uri: 'https://drive.google.com/viewerng/viewer?embedded=true&url=<ONLINE_PDF_LINK'}}
      style={{marginTop: 20}}
      />
  );
}

export default Flujograma;