HarmonyOS RNOH react-native-pdf展示了不需要的下载按钮

> hvigor ERROR: Schema validate failed.
Detail: Please check the following fields.
{
  instancePath: 'modules[2].srcPath',
  keyword: 'pattern',
params: { pattern: '^(\\./|\\.\\./)[\\s\\S]+$' },
  message: 'must match pattern "^(\\./|\\.\\./)[\\s\\S]+$"',
  location:
  '/Users/xxx/Desktop/harmony_flutter/.ohos/build-profile.json5:40:112'
}
{
  instancePath: 'modules[3].srcPath',
  keyword: 'pattern',
params: { pattern: '^(\\./|\\.\\./)[\\s\\S]+$' },
  message: 'must match pattern "^(\\./|\\.\\./)[\\s\\S]+$"',
  location:
  '/Users/xxx/Desktop/harmony_flutter/.ohos/build-profile.json5:52:105'
}

> hvigor ERROR: BUILD FAILED in 537 ms
hvigorw --mode module -p module=falcon_action_center,flutter_boost@default -p
product=default assembleHar --no-daemon invoke error.
Exception: assembleHar error! please check log.import Pdf from 'react-native-pdf';
import {View} from 'react-native';
import {useEffect, useState} from 'react';
import SplashScreen from 'react-native-splash-screen';
import ReactNativeBlobUtil from 'react-native-blob-util';

const Demo = () => {
  const [path, setPath] = useState('')
  useEffect(() => {
    SplashScreen.hide()
    ReactNativeBlobUtil.config({
      fileCache: true,
    }).fetch('get', 'xxx').then((res)=>{
      setPath(res.data)
    })
  }, []);
  return (
    <View style={{flex: 1}}>
  <Pdf
style={{
  marginTop: 20,
  flex: 1
}}
source={{uri: path}}
/>
  </View>
);
}
export default Demo

RNOH react-native-pdf展示了不需要的下载按钮。

HarmonyOS
1天前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
zbw_apple

使用资源地址时加上toolbar=0和navpanes=0两个参数。如:

Web({ src: 'resource://rawfile/test.pdf#toolbar=0&navpanes=0', controller: this.controller })
分享
微博
QQ
微信
回复
1天前
相关问题
HarmonyOS react-native-pdf三方库问题
55浏览 • 1回复 待解决
Swiper切换不需要动画
506浏览 • 2回复 待解决
HarmonyOS 适配 React native
351浏览 • 1回复 待解决