Need to show HTML page (with CSS) as a book with page flipping

ぐ巨炮叔叔 提交于 2020-01-03 03:57:28

问题


So I have a local HTML file with CSS and I need to display this file in the form of a book (scroll left/right to view previous/next content, not up and down). I've thought of a really complicated ways to achieve this:

  • A Gallery of WebViews
  • Disable scrolling in the WebView
  • On swipe, scroll the WebView down the height of the WebView

There's a couple of problems with this approach:

  • I'd have to have the HTML content loaded for each WebView (extremely inefficient)
  • There exists the possibility that at the bottom of the page, there would be some content partially hidden

I'm looking for some suggestions on how to approach this problem, as the only thing I've came up with sounds dreadful. Thanks!


回答1:


You could use two frames or iframes side by side and load odd page numbers in the left frame and even page numbers in the right frame. Put some fancy control buttons on each page, or a javascript scrollbar under the frames, and a div with a page-flipping animation that you can turn on or off when pages are loaded into the frames. I think it's totally doable, and could actually be pretty slick.




回答2:


I can't help you totally, but here is a good example for page curl animation with custom view.

https://github.com/harism/android_page_curl/tree/master/src/fi



来源:https://stackoverflow.com/questions/7303144/need-to-show-html-page-with-css-as-a-book-with-page-flipping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!