iOS Question Webview click event not working

db0070

Active Member
Licensed User
Longtime User
I have created a webview in designer, PageFinished event does fire but the Click event does not fire.
 

db0070

Active Member
Licensed User
Longtime User
I really don't understand that link and I have no idea how this works.

I have an image size 720 x 600, and I create a webview of width 600 and height = width*600/720 so the image is the same ratio. Now works fine on the iPad, but on the iPhone where the width is 300, the webview does not resize the image! I have tried the following code as well:-
B4X:
    If Main.ActivityWidth < 550 Then
        webView1.SizeToFit
        webView1.ScaleToFit = True
    End If

Webview appears to have its own life!! I am stuck

I have also tried adding the webview to a panel and set the webview to fit the panel.
 
Upvote 0

db0070

Active Member
Licensed User
Longtime User
Ok, I have solved it by putting the height and width of the image to be the same as the webview, inside the html of LoadHtml
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
I don't understand what this has to do with the title of your post and your first question about click event not working
 
Upvote 0

db0070

Active Member
Licensed User
Longtime User
I was struggling with click events and size of images in webview which did not work as I expected them to work.
The link: https://www.b4x.com/android/forum/threads/webview-touch-event.55966/ still does not make sense to me, but I think it is saying to embed this within the html. And that is what I did which made it work. But, you are right the title is misleading.

I have not done the click event yet as I don't need it now, but for the future, is there an example of a click event code for webview?
 
Upvote 0
Top