I have some content that I am placing on a UIScrollView on tvOS. I notice that even though I have bounces enabled on the scroll view in Interface Builder that my scrolling does not bounce at all. I have tried setting the bounces programmatically to no avail. Is this a 'feature' of tvOS?
I have created a subclass of UIScrollView, overriding canBecomeFocused and setting its panGestureRecognizer to allow for UITouchTypeIndirect. This allows for scrolling period. How do I reenable bounces for UIScrollView?
Related
I use SkiaSharp canvas to draw the main game screen, and then there are various Xamarin.Forms Buttons around the UI. This all works fine on when used directly on iPhone or iPad using a finger. However, when I connect a mouse (e.g., through a MacBook or otherwise), the buttons start working with about 10% chance after mouse-clicking on the SkiaSharp canvas (and not receiving the mouse click events with 90% chance). The SkiaSharp canvas itself works just fine.
If I bring up the iOS app launch menu from the bottom (which probably somehow temporarily exists the mouse navigation on the app), the buttons start working again with the mouse. But if I click the SkiaSharp canvas again with the mouse, the buttons have a high chance of becoming disabled again. If I change to using a finger, all works fine (even if the mouse clicks were not being registered immediately before). However, mouse clicks are not being registered even after touching with a finger, so finger-touching does not reset the issue with the mouse (but bringing up the menu from the bottom does).
We found this bug by testing the iOS game on MacBook Pro (the iOS apps recently came available on the App Store) but the same issue persists also directly with an iPad / mouse combination. It seems to be some sort of an issue between using a mouse (on iPad or on MacBook Pro), SkiaSharp canvas and Xamarin.Forms buttons.
Does anyone know what the root cause of the problem is and what is the workaround?
Not an answer as such, but some more information about reproducing the issue: A simpler repro case may be this small project: https://github.com/jrc14/TraceMatching/ .
Don't worry too much about what it's doing, but note that you're mean to click in the grey Skia canvas in the middle to create 'targets' - and that after you've done that, mouse-clicks are getting lost.
If you run it on a Mac, you'll see that, though the clicks get lost after you've clicked on the Skia canvas, they will start being received again if you click on something else (another app, or the Mac background).
(further edit) - after some noodling around I did find a workaround. If, once you've finished processing the touch action on the SKCanvasView, you reset its EnableTouchEvents property (i.e. set it to false, then back to true again), it seems that the clicks don't get lost any more,
When for some reason I disconnect my mouse on my iMac I noticie that the scroll bars on all NSScrollView instances remain visible. Now that I'm looking at my app on a macbook with "El Capitan" I see that with only a trackpad the same this is happening. The scrollbars remain visible, but it is unnecessary.
What is the reason for this behavior ? Could this behavior be changed vía a property in NSScrollView ?
Since Xcode got updated, i can't use swipe gesture. I have 2 UIViewController, i dragged a Swipe Gesture in the first and in the second. I connected them with Modal Action Segue. I tried in the simulator and on my device and both didn't work. It's so simple and i used to be able to do it but now it just doesn't work. Am i missing something ? I tried playing with the "State: Enable button" but that didn't worked. Normally i would just do a navigation bar with a button to change view but for this app i really want to you swipe gesture... Thanks
That was a stupid mistake... I dragged the Swipe Gestures on the background images. You need do drag them on the view itself. Just move the background image and drag the swipe gesture on the UIView and it should work!
Lol, I'm having trouble with that too.
I fixed it by making swipe gesture programatically
I am presenting fullscreen content on an external display in a uiscrollview. I want to allow pinching and zooming on the iPad which will pinch and zoom the uiscrollview on the external display. How to translate the iPad gestures to the other window?
Thank you
You have to put the UIScrollView on both the iPad AND the external display. I believe that you should just set the iPad's Window root view controller to the same view controller that controls the external display. You could probably "hide" the view on the iPad if you really wanted to, and I could tell you how to do that if you really want to, but it is out of the scope of this question.
In the latest version of OSX and safari you can use mouse swipe gestures to go forwards and backwards through your browser history. my problem: I have a page with a horizontally scrolling image gallery. If you're using the mouse swipe gesture to scroll through the images, when you get to the end of the images its very easy to swipe into the next or previous page...
does anyone know a way to explicitly disable this using css or any other method?
Perhaps the following documents can help:
Handling Gesture Events
Preventing Default Behaviour
: with event.preventDefault();
These might only apply to iOS though.
Aside from that, I would say it's just how the browser handles the gestures, similar to how mouse-wheel scrolling will scroll a DIV block until it reaches the end then start to scroll the page as a whole.
Unfortunately, there's no way to prevent this behaviour since it's a browser gesture (event.preventDefault() on touchstart event won't work).