iPad 并非所有屏幕都能识别触摸

发布于 2024-12-17 05:11:36 字数 782 浏览 4 评论 0原文

所以我当前的应用程序项目是一个基于相机的应用程序,到目前为止一切进展顺利,但我遇到了一个奇怪的小问题,不知道是否缺少一些基本的东西或者是否有更复杂的东西。

当我在 iPad 上以横向模式(右手主页按钮)运行我的应用程序时,屏幕的右端无法识别触摸事件,但如果一个项目分布在边界上(一半识别触摸,一半不识别触摸)并且当您按下好的一半并拖动时,它仍然可以识别触摸,并且当您放开时也可以识别触摸事件。通过测试,我发现它在 768 像素以下都可以正常工作,因此这让我认为其中一个视图认为该应用程序仍在纵向运行。但是当我纵向运行它时,底部部分(同一部分)也不起作用。

我查看了另外几篇关于SO的帖子:

第 1 条

第 2 条

我已经尝试过他们所说的修复,但到目前为止还没有运气。这可能与以下事实有关:我以编程方式和界面生成器中创建了各种不同的视图,并且在此过程中的某个地方,某些内容未正确初始化,但我已尝试全部更改它们,但我可能错过了一些。

如果有人能阐明我的情况,我将不胜感激。

谢谢,

马特

So my current app project is a camera based app and all is going well so far but I have run in to a weird little issue and don't know if there's something basic i'm missing or if it's something more complex.

When I run my app on the iPad in landscape mode (right hand home button), the right end of the screen doesn't recognise touch down events, though if an item is spread across the border (half recognising touches, half not) and you press on the good half and drag, it still recognises the touch and also recognises the touch up event when you let go. Through testing, I worked out that it works fine up to pixel 768 so this makes me think that one of the views thinks that the application is still running in portrait. But then when I run it in portrait, the bottom section (same portion) doesn't work either.

I have looked at another couple of posts on SO:

Article 1

Article 2

I have tried the fixes they say, but have had no luck as of yet. It may be something to do with the fact I have various different views created both programatically and in the interface builder and somewhere along the way, something isn't being initialised correctly but I have tried changing them all, I may have missed some though.

If anybody can shed any light on my situation, that would be greatly appreciated.

Thanks,

Matt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随心而道 2024-12-24 05:11:36

我认为这个问题与自动调整蒙版大小有关。这个你设置了吗?尝试设置所有视图的背景颜色以查看它们的位置。

I think the problem has something to do with autoresizing mask. Have you set this? Try to set the background color of all views to see where they are.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文