Android Question Change orientation of WebView

Roger Daley

Well-Known Member
Licensed User
Longtime User
Sub Globals

Private WebViewHelp As WebView
Private wve As WebViewExtras
End Sub

B4X:
Sub HelpSub_Click
    PnlWebview.Elevation = 4dip                                            'Brings WebView intoview
  
    wve.Initialize(WebViewHelp)
    wve.JavaScriptEnabled = True
    wve.LoadUrl(xui.FileUri(File.DirAssets, "helpfile.htm"))
  
   ' Sleep(1000)  checked for timing issue did not help
  
    Phone1.SetScreenOrientation(0)
End Sub

Hi All,
Second attempt. Please excuse the messy layout something went wrong.

I am displaying a help file {HTML] in a WebView which is on a panel. To make reading easier I am trying to show the Webview in Landscape, the App is Portrait.
The Help file is displayed OK until the orientation changes, then the main GUI is shown lanscape for a moment then goes back to portrait. Helpfile lost.

There is nothing shown in the error log.


Any ideas welcome as usual.

Regards Roger
 
Last edited:
Top