wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.58k stars 540 forks source link

zoom in and scrolling not working #727

Open swaroopaillinda opened 1 year ago

swaroopaillinda commented 1 year ago

I am using latest versions of react native and react native pdf as well

but the pinch to zoom in and scrolling not working at all

here is my code

` <Pdf ref={(pdf) => { this.pdf = pdf; }}

                    page={this.state.page}
                    source={{ uri: this.state.pdfdata }}
                    //resourceType={resourceType}
                    singlePage={true}
                    // horizontal={true}
                 // scale={this.state.scale}
                     maxScale={3.0}
                    onLoadComplete={(numberOfPages, filePath) => {
                      console.log(`number of pages: ${numberOfPages}`);
                    }}
                    onPageChanged={this.onPageChanged.bind(this)}
                    onError={(error) => {
                      console.log("ffffe", error);
                      this.setState({
                        error: true
                      })
                    }}
                    onPressLink={(uri) => {
                      console.log(`Link presse: ${uri}`)
                    }}

                    //spacing={5}
                    style={{
                      flex: 1,
                      width: "100%",
                      height: "100%",//sbackgroundColor:"green"

                    }} />`

                    Please let me know how to fix this
dkahdwk commented 1 year ago

@swaroopaillinda In the case of Android, the issue appears when combined with Bottom Sheet or Modal, and no complete solution has been found. In the case of scrolling, wrap it with a View tag and insert onStartShouldSetResponder={()=>true} to solve the problem, but not zoom-in. But in the case of iOS, all behavior is normal.

slayton-ct commented 5 months ago

@swaroopaillinda In the case of Android, the issue appears when combined with Bottom Sheet or Modal, and no complete solution has been found. In the case of scrolling, wrap it with a View tag and insert onStartShouldSetResponder={()=>true} to solve the problem, but not zoom-in. But in the case of iOS, all behavior is normal.

@dkahdwk I am trying to figure out what you mean here. I wrapped with a view and set onStartShouldSetResponder={()=>true} to attempt to scroll but this does not seem to work either. I am currently trying to display PDF within a BottomSheet and running into this issue with android as you described.