Ios 如何在单击提交时获取警报?
如何在单击提交时获取警报?Ios 如何在单击提交时获取警报?,ios,objective-c,uiwebview,Ios,Objective C,Uiwebview,如何在单击提交时获取警报? 我正在使用WebView 这是密码 UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; [webView setDelegate:self]; NSString *urlAddress = @“sssssss”; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestOb
我正在使用WebView 这是密码
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[webView setDelegate:self];
NSString *urlAddress = @“sssssss”;
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
提前感谢。检查此项:
- (BOOL)webView: (UIWebView*)webView shouldStartLoadWithRequest: (NSURLRequest*)request navigationType: (UIWebViewNavigationType)navigationType {
NSString *fragment, *scheme;
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
//1
[webView stopLoading];
fragment = [[request URL] fragment];
scheme = [[request URL] scheme];
if ([scheme isEqualToString: @"file"] && [self respondsToSelector: NSSelectorFromString(fragment)]) {
[self performSelector: NSSelectorFromString(fragment)];
return NO;
}
[[UIApplication sharedApplication] openURL: [request URL]];
}
return YES;
}
您需要将委托设置为WebView
希望这有帮助。1-在提交按钮中添加iAction
2-在调用的方法中,使用UIAlertController创建一个警报,单击按钮时将显示该警报。Sure@Sudheer Kolasani。你需要什么信息?您的问题解决了吗?我们如何知道,即单击“提交”按钮时,请检查onclick函数未调用itA。此处有明确说明-