As required by the project, you must disable the copy paste menu option in input when loading HTML using uiwebview.
Modify HTML page
Method 1:
Function onload ()
{
Document.doc umentelement. style. webkittouchcallout = "NONE"; // The menu is disabled.
Document.doc umentelement. style. webkituserselect = "NONE"; // do not select
}
Then add onload to the body.
<Body onload = "onLoad ()"/>
In actual tests, the copy and paste functions are not allowed in input.
HTML page content. The copy function is disabled.
Method 2:
<Style type = "text/CSS">
*{
-WebKit-user-select: none;/* disable selection/copy of uiwebview */
}
</Style>
In actual tests, the copy and paste function is disabled, but the keyboard input cannot be displayed in the webview input.
Modify IOS code:
Method 1:
-(Void) webviewdidfinishload :( uiwebview *) webview {
// Disable User Selection
[Webview stringbyevaluatingjavascriptfromstring: @ "document.doc umentelement. style. webkituserselect = 'none';"];
// Disable callout
[Webview stringbyevaluatingjavascriptfromstring: @ "document.doc umentelement. style. webkittouchcallout = 'none';"];
}
In the actual test, the copy and paste functions are not allowed in the input.
HTML page content. The copy function is disabled.
Method 2:
Obtain the uimenucontroller and forcibly hide the view of the menu item,
The actual test is effective and cannot be submitted to the app store.