я была такая же проблема, так что я обнаружил работу вокруг, чтобы иметь дело с этим В вашем сайте поставлены следующие яваскрипта строки в document.ready, в которых присутствуют выпадающий
var appname = 'yourappName';
var actionName = 'displayAlert';
var url = appname + '://' + actionName;
document.location.href = url;
В контроллер, имеющий UIWebView поставить следующие код
- (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 строка выполняются над кодом оленьей кожей dislpay любой ViewController, но это вызывает dropddown снова работать
Спасибо большое .. он работал как шарм! –