HomeiOS DevelopmentDisable bar that seems on the backside when a WebKit textual content...

Disable bar that seems on the backside when a WebKit textual content discipline is concentrated


I’ve an iOS app operating on Mac (it is not operating via Catalyst, it is the iOS app on Mac). It shows some net content material, together with some inputs. I might prefer to know methods to disable that darkish gray bar that seems on the backside of the app when a WebKit enter is concentrated.

This is a pattern code that lets you reproduce the difficulty:

import UIKit
import WebKit

class ViewController: UIViewController {

  personal var webView: WKWebView!

  override func viewDidLoad() {
    tremendous.viewDidLoad()
    
    let configuration = WKWebViewConfiguration()
    webView = WKWebView(body: .zero, configuration: configuration)
    webView.translatesAutoresizingMaskIntoConstraints = false
    
    view.addSubview(webView)
    
    NSLayoutConstraint.activate([
      webView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
      webView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
      webView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
      webView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
    ])
    
    let html = """
    <!DOCTYPE html>
    <html>
    <head>
        <meta title="viewport" content material="width=device-width, initial-scale=1.0">
        <model>
            enter {
                width: 100%;
                padding: 12px;
                font-size: 16px;
                border: 1px strong #ccc;
                border-radius: 8px;
                box-sizing: border-box;
            }
        </model>
    </head>
    <physique>
        <enter kind="textual content" placeholder="Faucet right here to focus" />
    </physique>
    </html>
    """
    
    webView.loadHTMLString(html, baseURL: nil)
  }
}

Disable bar that seems on the backside when a WebKit textual content discipline is concentrated

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments