假设我有一个 Webview 在另一个之上,并且我正在内部 Web 视图中加载一个页面。现在我想禁用外部 Webview 的所有用户交互。如何在桌面编程中实现这一点?
这是代码段:
IBOutlet WebView *innerWebView;
IBOutlet WebView *outerWebView;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
// NSString *path = [[NSBundle mainBundle] pathForResource:@"main" ofType:@"html"];
// NSURL *url = [NSURL fileURLWithPath:path];
[[myWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://icicibank.com"]]];
[outerWebView setDrawsBackground:NO];
[outerWebView setEditable:NO];
}
- (void)webView:(WebView *)webView decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(id < WebPolicyDecisionListener >)listener{
[myWebView setDrawsBackground:NO];
[myWebView setEditable:NO];
[outerWebView setDrawsBackground:YES];
[outerWebView setEditable:YES];
NSLog(@"hello");
[[outerWebView mainFrame] loadRequest:request];
[outerWebView webViewShow:outerWebView];
}
这些是出口。