您的位置:首页 > 移动开发

解决超链接添加 target="_blank"之后在WebView中不能打开

2013-06-12 12:04 609 查看
小竹小站:www.chinadev.cn

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification

{

[webViewsetUIDelegate:self];

}

- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request

{

NSLog(@"sss%@",sender);

NSUInteger windowStyleMask =    NSClosableWindowMask |

NSMiniaturizableWindowMask |

NSResizableWindowMask |

NSTitledWindowMask;

NSWindow * webWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) styleMask:windowStyleMask backing:NSBackingStoreBuffereddefer:NO];

WebView * newWebView = [[WebView alloc] initWithFrame:[webWindow contentRectForFrameRect:webWindow.frame]];

[newWebView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];

[webWindow setContentView:newWebView];

[webWindow center];

[webWindow makeKeyAndOrderFront:self];

[[newWebView mainFrame] loadRequest:request];

return newWebView;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐