Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
iOS 7 提供了一种UIScreenEdgePanGestureRecognizer检测从屏幕边缘滑入的功能。这个手势可以用Xcode中的iOS7模拟器模拟吗?在屏幕区域外单击并拖动只会移动整个模拟器框架。
UIScreenEdgePanGestureRecognizer
在模拟器版本 11.4 上,我看到了该选项
Window
Show Device Bezels
它显示了模拟手机周围的虚拟设备框架:
这允许在屏幕“外部”开始手势。UIScreenEdgePanGestureRecognizer我可以成功地从左侧触发。
您不必在边缘滑动即可触发 a UIScreenEdgePanGestureRecognizer,只需从非常靠近边缘的地方开始即可。如果我从边缘开始不超过约 15 个点,它就会起作用。
(如果是模拟器的话。我从来没有在设备上测试过)
附带说明:您必须为每个边缘创建一个gestureRecognizer。你不能 OR 边缘在一起,所以UIRectEdgeAll不会工作。
UIRectEdgeAll