iOS Question Problem swiping to left when using a webview on AS ViewPager

Sandman

Expert
Licensed User
Longtime User
I have a somewhat large project that I've mostly been testing in the Simulator. This project uses AS ViewPager, and the different pages in the pager contains webviews.

In the Simulator all works great, there are no problems swiping sideways in any direction. But when I now tried it on a real device I'm having problems swiping from the right to the left. There is a small strip on my screen that isn't covered by the webview, and when I swipe there, I have no problem going from right to left, so I know the pager actually works. For some unknown reason the pager works fine swiping from left to right, without using the small strip.

As best I can tell, there's not even an event generated for xclv_main_ScrollChanged when going from right to left (there is in the other direction). Which to me seems to indicate that the webview is consuming the event. Why it only does it in one direction I couldn't say.

Before I go down the rabbit hole to try to debug and solve this, I just want to check: Is there a known issue on iOS between webviews and AS ViewPager? (And why does it work fine in one direction, and not the other?)
 

Alexander Stolte

Expert
Licensed User
Longtime User
Before I go down the rabbit hole to try to debug and solve this, I just want to check: Is there a known issue on iOS between webviews and AS ViewPager? (And why does it work fine in one direction, and not the other?)

Thats why i created the AS_ViewPagerNative lib.
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
I had this working in another place in my app so before I started the work of incorporating AS ViewPagerNative I took another look to see if I could figure out why it worked in one place and not the other.

The code was identical. Checking the layouts in the Visual Designer, I could see that the properties were identical too. Well, if you ignore the margins. Actually, that was the only thing that differed between them. Long story short, if the left margin is set to zero it works fine. If the left margin is 10, the swipe doesn't work. Insane stuff. I tried some more values to see if I could figure out where the breaking point was, and I was getting some inconsistent results.

But then I saw it. The layout with the webview that worked with swipes did NOT use AutoScaleAll. And the layout where the swipe didn't work DID use AutoScaleAll.

So I reset all margin values to their original values and started doing tests with enabling/disabling AutoScaleAll. I can say with absolute certainty that having AutoScaleAll enabled did stop swipe work from right to left (but not the other direction) when using a webview. Clearly something strange is happening there. (It doesn't apply to my case, but I wonder if the people in the threads you linked to did use AutoScaleAll, and if it would have solved their problems.)

All of this was tested by cleaning the project between each run, it was run as debug on a real iPhone.

I've created a small Bug to log this:
 
Upvote 0
Top