webview does not reload when zoomed

yonson

Active Member
Licensed User
Longtime User
Hi, I am having a problem with webview. I've created a media player that plays an mp3 and displays an image at the same time. Because I want the user to be able to zoom in and out of the image, I display the images in a webview (correct me if I'm wrong but there is no way to do this with an imageview?).

This approach is working fine, just to clarify the core code (have missed out anything not relevant):-

Sub Globals
Dim wb_image As WebView
End Sub

Sub Activity_Create(FirstTime As Boolean)
wb_image.Initialize("")
End Sub

Sub loadImage
wb_image.LoadHtml("<html><body><img src etc etc etc /></body></html>")
End Sub

This is all working and loading fine. The problem is when I move from one track to the next.

If the web image IS NOT zoomed in anyway, then loadImage works fine.
If the web image IS zoomed, loadImage doesn't work, and the old image remains.

Here are a few things I've tried to fix it:-

  1. re initialize the web view in loadImage. Result = no change
  2. disable web zoom, then load image, then enable web zoom. Result = no effect
  3. Call a subroutine to reload the entire activity e.g. 'CallSub("", "Activity_Create"). Result = can't get this to work

All with no result. Sure there is someone who will know what the problem is - seems to be a bug but I assume there must be some kind of workaround.

Thanks everyone!
 

yonson

Active Member
Licensed User
Longtime User
thats fantastic thanks so much for that!
Yes I tried invalidating the web view, nothing happened.

The image view extras library is fantastic - one quick issue though is there anyway I can change the zoom setting? it seems to be preserving the zoom level when drawing the next image, I would like it to return to the default zoom level each time.

Thank you!
 

warwound

Expert
Licensed User
Longtime User
thats fantastic thanks so much for that!
Yes I tried invalidating the web view, nothing happened.

The image view extras library is fantastic - one quick issue though is there anyway I can change the zoom setting? it seems to be preserving the zoom level when drawing the next image, I would like it to return to the default zoom level each time.

Thank you!

Take a look here:

http://www.b4x.com/forum/libraries-...pan-zoom-imageview-help-needed.html#post72023

I've added a new method to the library which should do what you require.

Martin.
 
Top