Hi, I'm using a webview control and I want my app to be both in portrait and landscape mode.
With that, I mean that if the phone is on portrait position, the webview size should be a perfect square with dimensions half of the screen.
If the phone is on horizontal, which means on landscape position, I want the WebView to be completely full screen.
I'm able to set the WebView completely on full screen using
Change orientation of WebView but if I rotate the phone on portrait position, it doesn't resize like a normal square..
Project and activity attributes are the following
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
The WebView code
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Dim x As B4XView = WebView1
x.Rotation = 90
WebView1.JavaScriptEnabled=True
WebView1.LoadUrl( website url )
End Sub
and on designer, activity script
WebView1.Width = 100%y
WebView1.Height = 100%x
WebView1.HorizontalCenter = 50%x
WebView1.VerticalCenter = 50%y
How can I make the Webview to resize like a normal square when the phone is in vertical ( portrait position)? many thanks