tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] V2 to support iOS fullscreen viewcontroller

Open jyc5120 opened this issue 3 years ago • 2 comments

Describe the problem

Some app want to remove the top/bottom bar in iOS it will be awesome If Tauri could support that

Describe the solution you'd like

set viewcontroller fullscreen

Alternatives considered

No response

Additional context

No response

jyc5120 avatar Nov 04 '23 04:11 jyc5120

+1, especially helpful for a horizontally tilted game. I'd really appreciate an orientation option.

I guess the fullscreen option doesn't work yes?

adminy avatar Nov 08 '23 08:11 adminy

You can do it by implementing it manually via your own plugin. Here is my example swift code.

class FluyerMain: Plugin {
    @objc open override func load(webview: WKWebView) {
        guard let rootVC = UIApplication.shared.keyWindow?.rootViewController else { return }
        
        rootVC.edgesForExtendedLayout = .all
        rootVC.extendedLayoutIncludesOpaqueBars = true
        
        webview.backgroundColor = .clear
        webview.scrollView.backgroundColor = .clear
        webview.scrollView.contentInsetAdjustmentBehavior = .never
        
        webview.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        webview.frame = rootVC.view.bounds
        
        UIApplication.shared.keyWindow?.backgroundColor = .white
    }
}

luneflu avatar Jan 31 '25 07:01 luneflu