相关疑难解决方法(0)

禁用UIWebView中的用户选择

我有一个应用程序,我将内容加载到一个UIWebView并呈现此.我无法完全禁用用户交互,因为我希望用户能够单击链接.我只需要禁用用户选择.我发现你可以使用的互联网中的某个地方:

document.body.style.webkitUserSelect='none';
Run Code Online (Sandbox Code Playgroud)

我试着插入这个

[self.contentView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitUserSelect='none';"]; 
Run Code Online (Sandbox Code Playgroud)

webViewDidFinishLoad:

但是,它不起作用.我仍然可以在WebView中选择和复制文本.

什么想法可能会出错?

更新:这似乎只从iOS 4.3开始

webkit uiwebview mobile-webkit ios4 ios

118
推荐指数
9
解决办法
9万
查看次数

在流星线索应用程序iOS 9上的全局禁用放大镜

iOS9_glass

我已经测试了几种解决方法,用css禁用恼人的放大镜,但是在我的iOS9流星线上构建它会出现一段时间并在几毫秒之后淡出.

它正在iOS 8上运行,但现在没有在iOS 9上使用这个css代码:

body, body * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-user-callout: none !important;
    -webkit-touch-callout: none !important;
}
input, textarea {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-user-callout: default !important;
    -webkit-touch-callout: default !important;
}
*{
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none; /* Firefox all */
    -ms-user-select: none; /* IE 10+ */
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-modify: none;
}
Run Code Online (Sandbox Code Playgroud)

我错过了iOS 9的东西?

css loupe aero-glass cordova meteor

14
推荐指数
2
解决办法
3640
查看次数

标签 统计

aero-glass ×1

cordova ×1

css ×1

ios ×1

ios4 ×1

loupe ×1

meteor ×1

mobile-webkit ×1

uiwebview ×1

webkit ×1