With the following code, I load an image to a webview to zoom it in and out. Is it possible to set the backgroundcolor of the webview? The area under the image is always white:
B4X:
Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private wv As WebView
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
wv.Initialize("iv")
Page1.RootPanel.AddView(wv, 0, 0,100%x, 100%y)
wv.Color=Colors.red
wv.ScaleToFit=True
wv.SizeToFit
NavControl.ShowPage(Page1)
Dim ImagePath As String = (File.DirAssets & "/minion.png")
Dim w As String = "100%" 'Bildbreite wird auf die maximale Breite des Webviews gesetzt'
Dim h As String = "auto" 'Bildhöhe wird automatisch angepasst'
Dim TempHtml As String = "<html><body><img src=" & ImagePath & " width=" & w & " height=" & h & "></body></html>"
wv.LoadHtml(TempHtml)
End Sub