UIWebView去掉底部背景

来源:互联网 发布:极致物业软件 编辑:程序博客网 时间:2024/05/14 12:45

NSString *path = [[NSBundle mainBundle] pathForResource:@"avoutCN" ofType:@"html"];

    NSURL *url = [NSURL fileURLWithPath:path];

    NSURLRequest *request = [NSURLRequest requestWithURL:url];

    UIWebView *webView=[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 416+(isIPhone5?88:0))];

    webView.backgroundColor=[UIColor whiteColor];

    [webView loadRequest:request];

    webView.scrollView.showsVerticalScrollIndicator=NO;

    [webView setBackgroundColor:[UIColor clearColor]];

    [webView setOpaque:NO];

    for (UIView *subView in [webView subviews]) {

        if ([subView isKindOfClass:[UIScrollView class]]) {

            for (UIView *shadowView in [subView subviews]) {

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

                    shadowView.hidden = YES;

                }

            }

        }

    }

    [self.view addSubview:webView];

    [webView release];

0 0
原创粉丝点击