Android Question webview

Almora

Well-Known Member
Licensed User
Longtime User
hi,

A simple web viewer..

But it does not fit into the screen.

I wonder why.
 

Attachments

  • web.zip
    7 KB · Views: 192
  • Screenshot_2017-04-14-17-45-48.jpg
    Screenshot_2017-04-14-17-45-48.jpg
    358.9 KB · Views: 174

sorex

Expert
Licensed User
Longtime User
the document uses negative margins that's why it's shifted outside the screen on the left.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
The Webview object is set well although I prefer to put in the general script
B4X:
WebView1.Width=100%x
WebView1.Height=100%y

the problemisthat within thewebviewloads aPDF file thatislarger thanthe screenand thennotgettheFIT.It would be differentif it werean HTML page.In fact,try enteringa different URLand you willgetthe visionrequired

you can try to reduce the ZOOM.

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    Dim Obj1 As Reflector
    Obj1.Target = WebView1
    Obj1.RunMethod2("setInitialScale", 75 , "java.lang.int")
    WebView1.LoadUrl("http://www.pdf.investintech.com/preview/1fed0686-2120-11e7-922a-002590d31986/index.html")
End Sub

Unfortunately, the zoom back to 100% now it is not a permanent solution...
 
Last edited:
Upvote 0
Top