开发者

Scale down WebView content in iphone App

I am looking to display multiple web content in one main view.

I have created different WebView and make it's height and width to fit all in one view size of Lands开发者_C百科cape mode.

How to scale down web view content to show data in small size (as per WebView height and width) ?

I have built application using Interface builder.The view is interface with one tab bar of tab bar controller.

Thanks,


In principle you could use a scaling transform for any view and shrink it. However, a UIWebview is embedded in a fullscreen scrollview which I don't think will behave properly as a subview of another view (especially another subview.)

All the miniaturized web views I have seen have just been scaled images of the page. To make such an image you would draw the web view's CGLayer to a CGImage and then scale that image. It's the same process you would use to make thumbnails.

See Trevor Theodore's UIImage Categories for the necessary tools.


You can use scalesPageToFit property of the web view to make sure the webpage scales to fit the view.

If your web view is called webView, you can do the below:

webView.scalesPageToFit = YES;  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜