Hi al
Am trying to load a simple picture into a table in webview
Here is the code
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout( "Gallery" )
Dim page As String
Dim img_url As String
Dim img_width, img_height As Int
img_width = WebView1.Width / 0.75
img_height = WebView1.Height / 0.75
img_url = "http://--my-cloud-storage--/63205_111133175626440_100001892752894_94580_4513693_n.jpg"
page = "<html><table border='0' width='320px'><tr><td><img src='" & img_url & "' width=320px height=400px /></td></tr></table></html>"
WebView1.LoadHtml( page )
End Sub
this is the result
You notice the small white borders on the top and the left ?
(that little border is cutting off a minute part of the picture on the right and bottom)
Have tried it using
B4X:
<img src='blah' width='320' height='400' />
and with a default table (ie no border or width parameters and I always get that border.
Anyone know how to get rid of it - is it a B4A thing or a HTML thing ?
I don't think you can get rid of that margin, is not B4A but the HTML, however, the WebView reserves a few pixels on the right for the scroll bar, even if you don't use it, that's what I've noticed.