Вот мой код ниже:
Код: Выделить всё
import React, { Component } from 'react';
import {
StyleSheet,
Dimensions,
View
} from 'react-native';
import Pdf from 'react-native-pdf';
// Screen that shows the contents of a PDF
export default class OpenPdf extends Component {
static navigationOptions = {
title: 'Product Variants'
};
render() {
const source = require('../assets/Product_Variants_Electric_Connections.pdf');
return (
source={source}
onLoadComplete={(numberOfPages, filePath) => {
alert(`number of pages: ${numberOfPages}`);
}}
onPageChanged={(page, numberOfPages) => {
alert(`current page: ${page}`);
}}
onError={(error) => {
alert(`error`+error);
}}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
pdf: {
flex: 1,
width: Dimensions.get('window').width
}
});
Пожалуйста, подскажите, что мне не хватает.
Подробнее здесь: https://stackoverflow.com/questions/558 ... tual-andro
Мобильная версия