UIScrollView内两个可调整大小的UIWebViews [英] Two resizable UIWebViews inside UIScrollView

查看:128
本文介绍了UIScrollView内两个可调整大小的UIWebViews的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以下视图结构,嵌入2 UIWebViews和1 UIView(从其他xib加载)。



但是问题是,因为这需要在UIScrollView ,具有相同的印象这样是单页。 (只需要启用垂直滚动)。



在这些UIWebViews中,html内容是从NSString加载的。



UIWebView和子视图的大小(高度)是可变的。





任何建议,如何实现?

解决方案

blockquote>

重要提示:你不应该在
UIScrollView对象中嵌入
UIWebView或UITableView对象。如果这样做,可能会导致
意外行为,因为
两个对象的触摸事件可能会混淆和错误处理


http://开发人员。 apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html



但是,为什么不能让一个网页视图两个iframe,与您的两个html文件的内容?然后将此网络视图附加到uiview?



Iframe资源:
http://www.w3schools.com/tags/tag_iframe.asp


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?

解决方案

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

这篇关于UIScrollView内两个可调整大小的UIWebViews的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆