在iOS上点击SkiaSharp CanvasView后,Xamarin表单按钮停止接收鼠标点击

camsedfj  于 2022-12-07  发布在  iOS
关注(0)|答案(1)|浏览(303)

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?

368yc8dk

368yc8dk1#

不是这样的答案,而是关于重现问题的更多信息:一个更简单的重现案例可能是这个小项目:https://github.com/jrc14/TraceMatching/。不要太担心它在做什么,但请注意,你的意思是点击中间的灰色Skia画布来创建“目标”--在你这样做之后,鼠标点击会消失。如果你在Mac上运行它,你会看到,尽管在你点击Skia画布之后,点击会消失,如果您单击其他内容,则会再次开始接收(另一个应用程序或Mac背景)。(进一步编辑)-经过一番摸索,我确实找到了一个变通办法。(即,将其设置为false,然后再次设置为true),似乎单击不会再丢失,

相关问题