我試圖找到一種方法來限制整個PhoneGap應用程序中的文本選擇。任何人都知道如何做到這一點?從PhoneGap中刪除文本選擇iOS應用程序
3
A
回答
2
html {
-webkit-user-select: none;
}
這個小成分在你的css代碼中會做到神奇!
+0
我使用這個響應以及@Suhas -webkit-touch-callout並且它工作得很好...爲兩個投票... – agfa555 2015-05-21 10:58:07
3
這會爲你工作: -
<style type="text/css">
*:not(input):not(textarea) {
-webkit-user-select: none; /* disable selection/Copy of UIWebView */
-webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
}
</style>
使用Java腳本: -
document.documentElement.style.webkitTouchCallout = "none";
document.documentElement.style.webkitUserSelect = "none";
2
在iOS系統9有這使得-webkit-user-select: none;
不起作用的錯誤。有哪些修復此
https://github.com/EddyVerbruggen/cordova-plugin-ios-longpress-fix
感謝弗雷德裏克Wessberg https://stackoverflow.com/a/32737049/741850
+0
感謝這個解決了它。自從插件沒有那麼做以來,你可能會考慮只是複製實現。 – 2015-10-14 08:42:26
相關問題
- 1. 使用PhoneGap在Android應用程序中選擇文本?
- 2. 刪除ios中的應用程序滾動Phonegap
- 3. 從iPhone/iOS應用程序的日期選擇器中刪除年份
- 4. iOS NSFileManager - 從主應用程序包中刪除文件
- 5. iOS Facebook從Phonegap登錄應用程序崩潰應用程序
- 6. 從iOS應用程序中刪除徽章應用程序圖標
- 7. 從IOS應用程序中的字符串中刪除'\'
- 8. 在PhoneGap中禁用文本選擇
- 9. 通過iOS應用程序從Parse中刪除PFFile
- 10. 從ios應用程序中刪除結構框架
- 11. 從ios cordova應用程序中刪除splashscreen
- 12. 從iOS中刪除應用程序時刪除服務器上的對象
- 13. 從後臺刪除應用程序或在iOS中刪除的事件
- 14. 從WinForms應用程序中刪除ClickOnce
- 15. 從appstore中刪除iPhone應用程序?
- 16. 從IIS7中刪除應用程序c#
- 17. 在iOS應用程序中從S3存儲桶中刪除文件(Swift)
- 18. 刪除的應用程序圖標和文本從動作條
- 19. 顯示在設置應用程序中爲iOS應用內容刪除選項
- 20. 如何從ELCImagePickerController選擇的照片應用程序中刪除多個圖像?
- 21. PhoneGap iOS應用程序配置菜單
- 22. PhoneGap iOS應用程序明顯慢?
- 23. 如何從應用程序中刪除ios今日擴展程序
- 24. Rails 3/PhoneGap:將Rails應用程序轉換爲Phonegap iOS應用程序?
- 25. 從CEdit控件中的初始化文本中刪除選擇(取消選擇)
- 26. 從應用程序中刪除應用程序時刪除應用程序的相關下載
- 27. Phonegap企業iOS應用程序沒有應用程序商店
- 28. 如何獲取應用程序版本並構建iOS PhoneGap應用程序?
- 29. 從應用程序文件夾(Google Drive)中刪除文件
- 30. 從Winforms應用程序的工具欄中刪除選項卡
似乎是重複的插件:http://stackoverflow.com/questions/5995210/disabling-user-selection-in -uiwebview – poiuytrez 2013-03-11 15:28:23