简体   繁体   中英

How to embed scrollview to tableview cell?

I have a scrollview embedded in a cell of tableview. The scrollview is a Foxit PDF rendering engine.

I want to scroll vertically the tableview, horizontally the scroll view. I couldn't. As on the first GIF you see scrollview is bouncing even the content height and scroll height is equal. But at least paging is possible.

在此处输入图片说明

Then I added a custom scrollview over the Foxit view into the cell. The bouncing disappeared and scrolling up and down the scrollview scrolls the table view. That is good. But now I can not horizontally scroll and change pages of the PDF.

在此处输入图片说明

What to do how to "merge" the two approach?

Try to play with panGestureRecognizer of scrollView and tableView. Install a relationship to prevent scrollView getting gestures before tableView scrollView.panGestureRecognizer.require(toFail: tableView.panGestureRecognizer) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM