React native 使用expo使用react native显示脱机pdf
正如标题所说,我正试图在react native using EXPO上显示一个保存在assets文件夹中的pdf文件,有什么办法吗? 现在我有了一个即时的解决方案,它显示了一个GoogleDrive读取pdf的网络视图,但我想用本地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”导入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;