简体   繁体   English

在UIWebview中缩放div标签

[英]zoom a div tag in UIWebview

I have a webpage click here to see and it contains a div tag with the dimension 350 X 207. This is fixed size. 我有一个网页, 请单击此处查看 ,它包含一个尺寸为350 X 207的div标签。这是固定大小。

In my iphone screen I need to enlarge/zoom and display the div(in landscape). 在我的iPhone屏幕上,我需要放大/缩放并显示div(横向)。 I tried the below two lines one at a time in my html file. 我在HTML文件中一次尝试了以下两行。 //This line zooms the page but unable to customise the size. //此行缩放页面,但无法自定义尺寸。

Any help would be appreciated! 任何帮助,将不胜感激! Thanks. 谢谢。

Before doing this programmatically I'd try checking off the "Scales Pages to Fit" property in Interface Builder in the UIWebView Attributes inspector. 在以编程方式执行此操作之前,我将尝试在UIWebView Attributes检查器的Interface Builder中检查“ Scales Pages to Fit”属性。

As mentioned here , you can also set the zoom scale: 如前所述在这里 ,你还可以设置缩放比例:

 for (UIScrollView *scroll in [webView subviews]) {
    // Set the zoom level.
    [scroll setZoomScale:2.5f animated:YES];
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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