Descartar UIActionSheet abierta desde UIWebView

I use a web view with auto detecting phone numbers. If I tap on a phone link in the web view on my iPad the default action sheet is opened with add to contacts, copy and cancel buttons. Since I have no reference to the menu how can I dismiss this sheet when the app enters background state?

Best Regards Carsten

preguntado el 02 de febrero de 12 a las 10:02

means you want to disable that link ? -

Nope I want to execute the default action (in this case the action sheet is opened automatically) and dismiss the action sheet if the app is suspended. I am just curious if this is possible and how. -

1 Respuestas

Podrías intentar mirar el UIWebView Development Document, more importantly webView:shouldStartLoadWithRequest:navigationType: and you can look at the UIActionSheet delegate function referenced from this stackoverflow link iPhone Detecting if a UIAlert UIActionSheet are open and in the delegate method, you can see that

if ([view isKindOfClass:[UIActionSheet class]] && [[view buttonTitleAtIndex:0] isEqualToString:@"Call"]) {
    // Dismiss actionSheet
}

También mira dismissWithClickedButtonIndex:animated: in Referencia de clase UIActionSheet which may do what you are looking for in terms of closing.

contestado el 23 de mayo de 17 a las 15:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.