Two resizable UIWebViews inside UIScrollView

杀马特。学长 韩版系。学妹 提交于 2019-12-11 08:09:01

问题


I need following view structure, with embedded 2 UIWebViews and 1 UIView (loaded from other xib).

But the problem is, because this need to be inside UIScrollView, with same impression like this is single page. (only vertical scrolling need to be enabled).

In those UIWebViews, html content is loaded from NSString.

Size (height) of UIWebViews and child view is variable.

Any advice, how to do that?


回答1:


Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html

However why cant you make a webview that has two iframes, with the content of your two html-files? Then attach this webview to the uiview?

Iframe resource: http://www.w3schools.com/tags/tag_iframe.asp



来源:https://stackoverflow.com/questions/4933446/two-resizable-uiwebviews-inside-uiscrollview

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