1.隐藏上下滚动时出边界的后面的黑色的阴影

- (void) hideGradientBackground:(UIView*)theView
{
  for (UIView * subview in theView.subviews)
  {
    if ([subview isKindOfClass:[UIImageView class]])
      subview.hidden = YES;

    [self hideGradientBackground:subview];
  }
}

 

2. 禁用拖拽时的反弹效果

[(UIScrollView *)[[webView subviews] objectAtIndex:0] setBounces:NO];  

 

3. 判断用户点击类型

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    switch (navigationType) 
    {
        //点击连接
        case UIWebViewNavigationTypeLinkClicked:
        {
            NSLog(@"clicked");
        }
            break;
        //提交表单
        case UIWebViewNavigationTypeFormSubmitted:
        {
            NSLog(@"submitted");
        }
        default:
            break;
    }
    return YES;
}

相关文章:

  • 2021-11-16
  • 2021-09-09
  • 2022-12-23
  • 2021-09-06
  • 2021-12-10
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
猜你喜欢
  • 2021-04-27
  • 2022-12-23
  • 2020-03-31
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-11-09
相关资源
相似解决方案