我使用 react-native-Pdf 在我的应用程序中打开 PDF 文件,PDF 视图需要一个高度和宽度来显示 PDF,但是当我设置一个高度时,我无法滚动整个 pdf,因为有一个固定的高度,所以怎么能我解决问题?
<View style={footerStyle.main}>
<ScrollView>
<View >
<Pdf resizeMode={'wrap'}
source={source}
onLoadComplete={(numberOfPages, filePath) => {
console.log(`number of pages: ${numberOfPages}`);
}}
onPageChanged={(page, numberOfPages) => {
console.log(`current page: ${page}`);
}}
onError={(error) => {
console.log(error);
}}
onPressLink={(uri) => {
console.log(`Link presse: ${uri}`);
}}
style={footerStyle.pdf}
/>
</View>
import {StyleSheet,Dimensions} from 'react-native';
const width=Dimensions.get('window').width
const height=Dimensions.get('window').height
const footerStyle = StyleSheet.create({
main:{
flex:1,
},
pdf: {
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
},
footer:{
flexDirection:'row',
backgroundColor:"#053f5c",
justifyContent: 'space-between'
}