Entire page in a webview

ciginfo

Well-Known Member
Licensed User
Longtime User
Hello,
In a webview, when opening an URL, how to get to that the entire page of a site contains inside. As in the attached photo No 1 and not as in the photo No. 2
thank you
 

Attachments

  • num1.jpg
    num1.jpg
    43.8 KB · Views: 267
  • num2.jpg
    num2.jpg
    22.3 KB · Views: 337

NJDude

Expert
Licensed User
Longtime User
You will need to use the library Margret pointed out and do this:
B4X:
Dim web As WebViewSettings

web.setUseWideViewPort(WebView1, True)
web.setLoadWithOverviewMode(WebView1, True)

WebView1.LoadUrl("http://www.basic4android.com")
 
Upvote 0

kanaida

Active Member
Licensed User
Longtime User
I set the zoom to 1 or 100 can't remember. I can't remember if I used a web view library to do that either but it zoomed my HTML to fit the width.
 
Upvote 0

enrico

Active Member
Licensed User
Longtime User
I have a problem with Webview in devices with 120 dpi (scale 0.75).
For example I want to display a 100x100 pixel png image using Webview.
In devices with 160, 240 or 320 dpi it is displayed correctly in its full size (screenshot1).
In a 120 dpi device it is bigger than the frame (screenshot2) and I don't know how to fix it.

I've used this code :
B4X:
Dim WebViewSymbol As WebView
Dim Panel0,Panel1 As Panel
Dim ScrollView1 As ScrollView
ScrollView1.Initialize(500dip)
Activity.AddView(ScrollView1,0,10dip,100%x,100%y - 10dip)
Panel0 = ScrollView1.Panel
Panel0.Color = Colors.Gray
Panel0.Height = 106dip
Panel1.Initialize("")
Panel0.AddView(Panel1,0,1dip,ScrollView1.Width,104dip)
Panel1.Color = Colors.Black
WebViewSymbol.Initialize("")
WebViewSymbol.ZoomEnabled = False
WebViewSymbol.Visible = True
WebViewSymbol.LoadUrl("file:///android_asset/symbol.png")
Panel1.AddView(WebViewSymbol,2dip,2dip,100dip,100dip)
 

Attachments

  • screenshot1.png
    screenshot1.png
    30.8 KB · Views: 207
  • screenshot2.png
    screenshot2.png
    11.1 KB · Views: 189
Upvote 0

enrico

Active Member
Licensed User
Longtime User
If I add these lines :
B4X:
Dim web As WebViewSettings
web.setUseWideViewPort(WebViewSymbol, True)
web.setLoadWithOverviewMode(WebViewSymbol, True)

This is the result :
 

Attachments

  • screenshot3.png
    screenshot3.png
    8.8 KB · Views: 206
Upvote 0

enrico

Active Member
Licensed User
Longtime User
Yes. I load the files from internet with webview.
I put it in local folder only for example.
 
Upvote 0
Top