Suddenly can no longer click image in mobileTableCustomCell?

I have an iOS app that has been in development for a while, and it uses mobileTableCustomCells to fill an IOSMobileTable.

Some of these custom cells have mobileImageViewer controls in them and display a picture.

In the past, I have been able to click anywhere in the row (picture, text, where ever) and it will trigger SelectionChanged for the table.

Recently I noticed that I cannot click the images anymore. Clicking them does nothing (giving the illusion that the app has stalled).

I did just install 2025r2.1. I haven’t had time to go back and check previous versions, but I will do that soon and update this post.

Has anyone else experienced this issue?

I don;t use the click feature. Maybe you can overlay a MobileCanvas to capture the clicks?

Yeah, if it turns out this is a deliberate change and not a bug I will try the MobileCanvas trick. I’ve had to do similar stuff to make maps clickable.

Maybe they made this change deliberately so that you could have better control over what is clicked?

I guess that’s what I’m trying to figure out: was this a deliberate change to give fine-tuned control, or a bug that’s going to be fixed in the future?

It’s not a bug but could be considered one.

Since a recent update of Xojo, MobileImageViewer has a Pressed event.
The problem is that the underlying code for the Pressed event is set up even if the Pressed event isn’t used in code.

You might be able to get the old behavior with the following declare

Declare sub disableInteraction Lib "Foundation" selector "setUserInteractionEnabled:" (obj as ptr, value as boolean)
disableInteraction(theMobileImageViewer.handle, True)

(written from my phone, untested)

3 Likes

Actually the code should be:

Declare sub UserInteraction Lib "Foundation" selector "setUserInteractionEnabled:" (obj as ptr, value as boolean)
UserInteraction(theMobileImageViewer.handle, False)
2 Likes

Oh, thank you! And sorry I didn’t thank you earlier, I didn’t see the reply.

That did the trick!

In case anyone want a method you can drop in a module and then call .fixPictureClick() on your MobileImageViewer, here’s one:

Public Sub fixPictureClick(extends myImage as MobileImageViewer)
Declare sub UserInteraction Lib “Foundation” selector “setUserInteractionEnabled:” (obj as ptr, value as boolean)
UserInteraction(myImage.handle, False)
End Sub

1 Like