私は同じ問題を持っていた私は、次のように置くドロップダウンはあなたのコントローラがのUIWebViewを持って
var appname = 'yourappName';
var actionName = 'displayAlert';
var url = appname + '://' + actionName;
document.location.href = url;
存在しているdocument.readyはJavaScriptライン以下のウェブサイトのプットでは、それ に対処するための回避策を見出したので、コード
- (BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
// these need to match the values defined in your JavaScript
NSString *myAppScheme = @"wfsapp";
NSString *myActionType = @"displayAlert";
// ignore legit webview requests so they load normally
if (![request.URL.scheme isEqualToString:myAppScheme]) {
return YES;
}
// get the action from the path
NSString *actionType = request.URL.host;
// look at the actionType and do whatever you want here
if ([actionType isEqualToString:myActionType]) {
/* UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Loading"
message:@"Initialising Search Filters..."
delegate:self
cancelButtonTitle:NULL
otherButtonTitles:nil];*/
//[alert show];
/* UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@""
message:NULL
preferredStyle:UIAlertControllerStyleActionSheet];
alertController.view.hidden = YES;
alertController.modalPresentationStyle = UIModalPresentationCurrentContext;
alertController.view.backgroundColor = [UIColor clearColor];*/
UIViewController *alertController = [UIViewController alloc];
alertController.view.hidden = YES;
alertController.view.backgroundColor = [UIColor clearColor];
self.view.backgroundColor = [UIColor clearColor];
self.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:alertController animated:NO completion:^ {
}];
[alertController dismissViewControllerAnimated:NO completion:nil];
}
ページの読み込みとjavascriptのラインは、コードのdoesnt上で実行されているすべてのViewControllerをdislpayが、それは再び
を仕事にdropddownトリガー
ありがとうございました。魅力的に働きました! –