iphone - 关闭从 UIWebView 打开的 UIActionSheet

标签 iphone ios webview uiactionsheet dismiss

我使用带有自动检测电话号码的 WebView 。如果我在我的 iPad 上点击 WebView 中的电话链接,则会打开默认操作表,其中包含添加到联系人、复制和取消按钮。由于我没有引用菜单,当应用程序进入后台状态时,我该如何关闭此工作表?

最好的问候 卡斯滕

最佳答案

您可以尝试查看 UIWebView Development Document ,更重要的是 webView:shouldStartLoadWithRequest:navigationType: 您可以查看从此 stackoverflow 链接引用的 UIActionSheet 委托(delegate)函数 iPhone Detecting if a UIAlert UIActionSheet are open在委托(delegate)方法中,您可以看到

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

另请参阅 UIActionSheet Class Reference 中的 dismissWithClickedButtonIndex:animated:这可能会满足您在关闭方面的需求。

关于iphone - 关闭从 UIWebView 打开的 UIActionSheet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9110789/

相关文章:

ios - iphone怎么画椭圆和其他形状

iphone - Facebook SDK iOS - 授权应用内?

android - WebView 在 onPause 后不显示内容

android - 无法解析 Android Studio 上的符号 webView

android - 当我集成我的应用程序以使用 instagram 登录时如何解决 webview 错误

ios - iTunes Connect 销售和趋势报告

ios - Xcode 7 自动布局是否损坏或难以使用

objective-c - 创建tableview后如何解决ios异常?

ios - 在 Swift 中实现核心数据验证方法

iphone - 如何增加backgroundTimeRemaining