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;

    }

  • 相关阅读:
    我所认识的JavaScript
    谈如何边做事,边提高
    对JavaScript开发中困扰的思考
    Soundex语音算法
    Perl分割字符串的一个精妙的写法
    Perl深拷贝
    Git diff hash顺序的问题
    perl命令行批量修改文件内容
    IOS写文件
    删除Linux乱码文件
  • 原文地址:https://www.cnblogs.com/swallow37/p/2845479.html
Copyright © 2011-2022 走看看