【发布时间】:2012-06-08 03:55:04
【问题描述】:
假设我有一个 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];
}
这些是网点。
【问题讨论】:
-
什么是“一个 web 视图优于另一个”? Webview 的
-setEditable:有效吗?
标签: objective-c cocoa webview