iOS面试

2016-03-08  本文已影响260人  WangDavid

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;
}
上一篇下一篇

猜你喜欢

热点阅读