【问题标题】:zoom in on a uiwebview by taping?通过录音放大uiwebview?
【发布时间】:2010-05-26 12:37:50
【问题描述】:

在 Safair 移动版中,如果您有显示的 html 页面,您可以通过双击放大。 但是,如果您使用 uiwebview 并显示图像或 pdf 文件,则必须双指打开才能缩放。

我的问题是:在 uiwebview 中显示图像或 pdf 文件时,我需要做什么才能让双击工作?

你能不能让 uiwebview 成为 uiscrollview 下的子视图,然后你能双击缩放吗? 你会怎么做呢?

【问题讨论】:

  • 好吧,我想你可以在 UIWebView 的左侧贴上一条胶带,然后在右侧贴上另一条,然后将两者拉开。

标签: iphone pdf sdk uiwebview zooming


【解决方案1】:

Mobile Safari 中双击的真正作用是关注内容。它会在您点击的网页上找到div 或部分,然后缩放以聚焦。这不仅仅是“双击缩放”。

【讨论】:

    【解决方案2】:

    要从 UIWebview 获得双击,你需要继承 UIWindow 并使用该方法,

    - (void)sendEvent:(UIEvent *)event {
        NSLog(@"tap detect");
        NSArray *allTouches = [[event allTouches] allObjects];
        UITouch *touch = [[event allTouches] anyObject];
        UIView *touchView = [touch view];
    
        if (touchView && [touchView isDescendantOfView:urWebview]) {
            //
            // touchesBegan
            //
                   if(touch.tapCount==2){
                         //
                    // doubletap
                    //
                   }
           }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-22
      • 1970-01-01
      相关资源
      最近更新 更多