iPad风景开始变得混乱 [英] iPad Landscape messing up touches began

查看:166
本文介绍了iPad风景开始变得混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序仅允许在横向方向上使用,并且在风景中启动。因此,iPad横向时的左上角是(0,0),所以一切正常。

My app is only allowable in the landscape orientations, and it launches in landscape. Thus, the top left corner when the iPad is landscape is (0,0), so everything works fine.

然而,当我拿起touchesBegan时......它运作不正常。只有当我点击iPad的正确三分之二时,它才会接触到它。我知道它与方向有关,因为应用程序实际上只是空白屏幕,只有一个UIView,没有别的。这很简单。没有其他可能导致此问题的问题。

However, when I pick up "touchesBegan"...it isn't working properly. Only when I tap on like the right two-thirds of the iPad does it pick up the touches. I know it has something to do with the orientation, because the app is literally just blank screen with a single UIView and nothing else. It is quite simple. There are no other possible problems that would cause this.

如果我打印出touchesBegan功能中的x位置,并且如果使用左侧的主页按钮保持iPad,则宽度为1024。 1024-768是256.这正是它开始感知触摸的x位置。 x = 256左边的任何东西都不能感知触摸。

To be sepecific, if I print out the x location in the touchesBegan function, and if the iPad is held with the home button on the left, the width is 1024. And 1024-768 is 256. This is exactly the x position where it begins to sense my touches. Anything to the left of x=256 does not sense the touches.

如何解决此问题?

推荐答案

检查Struts和Springs确保接触到的任何东西覆盖整个区域并锁定到4边。

Check Struts and Springs and make sure that whatever should pick up the touches is covering the whole area and locked to the 4 sides.

这篇关于iPad风景开始变得混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆