rumax / react-native-PDFView

📚 PDF viewer for React Native
MIT License
300 stars 92 forks source link

PDF disappears in IOS #31

Closed gdierksmeier closed 6 years ago

gdierksmeier commented 6 years ago

When you click the pdf it disappears and the whole screen goes blank ( Only IOS...Android is OK )

rumax commented 6 years ago

Can you reproduce it with demo project? Release or debug build?

gdierksmeier commented 6 years ago

Thanks, tomorrow i will try to create an example...the problem appears in both release and debug...

The code is simple import PDFView from 'react-native-view-pdf';

  let resource = this.state.pdfBase64;
  let resourceType = 'base64';
  return (
    <Container>
      <Content>
        <View style={{ height: platformStyle.deviceHeight, width: platformStyle.deviceWidth }}>
        <PDFView
          style={{ height: platformStyle.deviceHeight, width: platformStyle.deviceWidth }}
          resource={resource}
          resourceType={resourceType}
        />
        </View>
      </Content>
      <Footer noBorders padder>
        <FooterTab>
          <Button full primary rounded onPress={() => this.SavePDF()}>
            <Text>Save PDF</Text>
          </Button>
          <Button full primary rounded onPress={() => this.GoList()}>
            <Text>Go Back</Text>
          </Button>
        </FooterTab>
      </Footer>
    </Container>
  )

Versions "dependencies": { "@mapbox/geo-viewport": "^0.2.2", "async": "2.5.0", "color": "1.0.3", "jest-cli": "20.0.4", "lodash": "4.13.1", "moment": "2.13.0", "native-base": "2.3.10", "numeral": "^2.0.6", "react": "16.2.0", "react-dom": "^16.3.2", "react-native": "0.53.3", "react-native-action-button": "^2.8.3", "react-native-android-location-enabler": "^1.0.5", "react-native-animatable": "^1.2.4", "react-native-background-timer": "1.2.0", "react-native-camera": "0.12.0", "react-native-checkbox": "^1.2.0", "react-native-config": "^0.11.5", "react-native-datepicker": "1.6.0", "react-native-device-info": "0.11.0", "react-native-device-log": "1.0.2", "react-native-easy-grid": "0.1.15", "react-native-fetch-blob": "0.10.8", "react-native-gifted-chat": "^0.3.0", "react-native-i18n": "2.0.6", "react-native-image-picker": "0.26.7", "react-native-image-zoom-viewer": "^2.0.19", "react-native-interactable": "^0.1.10", "react-native-loading-spinner-overlay": "0.5.2", "react-native-maps": "0.20.1", "react-native-openanything": "^0.0.3", "react-native-popup-dialog": "0.9.39", "react-native-queue": "^1.2.1", "react-native-spinkit": "1.1.1", "react-native-svg": "^6.3.1", "react-native-swipe-gestures": "1.0.2", "react-native-swiper": "1.5.13", "react-native-switch-pro": "^0.4.10", "react-native-vector-icons": "4.4.3", "react-native-view-pdf": "^0.1.22", "react-navigation": "1.3.2", "react-redux": "5.0.5", "react-timer-mixin": "^0.13.3", "realm": "2.2.20", "redux": "3.7.2", "redux-form": "7.2.3", "redux-persist": "4.8.3", "redux-thunk": "2.2.0", "remote-redux-devtools": "0.5.0", "remote-redux-devtools-on-debugger": "^0.8.0", "uuid": "^3.1.0", "victory-native": "^0.17.4" },

rumax commented 6 years ago

Thanks for more information. Does this happens on device, simulator or both?

In your code I also see that you use Content and

after that you also have Footer. Is the Footer has absolute position and above the PDFView?

Is it possible that SavePDF is triggered? And do you have some event listeners in Container or Content? Or maybe platformStyle.deviceHeight is changed?


You can also use flex 1 for PDFView: <PDFView style={{ flex: 1 }}. And it should work without parent View, so it can be child of the Content

rumax commented 6 years ago

@gdierksmeier do you still have this issue and need help? or it can be closed?

gdierksmeier commented 6 years ago

Sorry, i forgot to replay....It can be closed. Now is working fine in Android and IOS. Thanks a lot!