zoukankan      html  css  js  c++  java
  • web使用

    contentWeb =  [[UIWebViewalloc] initWithFrame:CGRectMake(10, 0, 300, 135)];

            contentWeb.layer.cornerRadius = 8;

            contentWeb.layer.masksToBounds = YES;

            contentWeb.dataDetectorTypes = UIDataDetectorTypeNone;//去掉下划线

    //        contentView.scalesPageToFit = YES;

            contentWeb.backgroundColor = [UIColorclearColor];

            [self addSubview:contentWeb];

            contentWeb.hidden = YES;

            UIScrollView *scroller = [contentWeb.subviews objectAtIndex:0];//去掉上下阴影

            if (scroller) {

                for (UIView *v in [scroller subviews]) {

                    if ([v isKindOfClass:[UIImageView class]]) {

                        [v removeFromSuperview];

                        }

                   }

            }

    - (BOOL)webView:(UIWebView *)webViewLocal shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 

    {

    NSString *myURL = [[request URL] absoluteString];

        //    NSLog(@"%@", myURL);//进来时:about:blank  http://www.baidu.com/

        if([myURL hasPrefix:@"http:"])

    {

            //        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:(NSString *)[myURL substringFromIndex:[@"http:" length]]]];

            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:myURL]];

            return NO;

        }

    return YES;

    }

  • 相关阅读:
    生成函数trick
    带权并查集维护二分图
    关于二项式反演的一些思考
    CSP集训记录
    解决Maven版本冲突
    蚂蚁金服5轮面试,最后栽这了...
    配置交换机Eth-Trunk+VRRP+MSTP+接口BFD状态联动+Telnet示例
    企业园区网络建设技术方案(华为)
    网络三层架构
    SOA治理
  • 原文地址:https://www.cnblogs.com/swallow37/p/2845479.html
Copyright © 2011-2022 走看看