iOS面试

作者: WangDavid | 来源:发表于2016-03-08 23:53 被阅读260次

    1.给UIview添加背景图片最简单方法

    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"11.jpg"]]];
    

    2.iOS 获取UIWebView上面的按钮点击事件

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    {
    //判断是否是单击
        if (navigationType == UIWebViewNavigationTypeLinkClicked)
        {
            NSURL *url = [request URL];
            if([[UIApplication sharedApplication]canOpenURL:url])
            {
                [[UIApplication sharedApplication]openURL:url];
            }
            return NO;
        }
        return YES;
    }
    

    相关文章

      网友评论

          本文标题:iOS面试

          本文链接:https://www.haomeiwen.com/subject/efdzkttx.html