xcode 是否可以在 iOS 模拟器中进行边缘滑动?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19127383/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to do an edge swipe in iOS simulator?
提问by user2709279
iOS 7 provides for a UIScreenEdgePanGestureRecognizer
which detects swipes in from edges of the screen. Can this gesture be simulated using the iOS7 simulator in Xcode? Clicking and dragging outside the screen area just moves the whole simulator frame around.
iOS 7 提供了一种UIScreenEdgePanGestureRecognizer
检测从屏幕边缘向内滑动的方法。这个手势可以用Xcode中的iOS7模拟器模拟吗?在屏幕区域外单击和拖动只会移动整个模拟器框架。
回答by Matthias Bauch
You don't have to swipe across the edges to trigger a UIScreenEdgePanGestureRecognizer
, just start very close to the edge. It works if I start not more than ~15 points from the edge.
您不必滑过边缘来触发UIScreenEdgePanGestureRecognizer
,只需从非常靠近边缘的地方开始。如果我从边缘开始不超过 ~15 个点,它就会起作用。
(this if for the simulator. I never tested this on a device)
(这是模拟器。我从未在设备上测试过)
As a side note: You have to create a gestureRecognizer for each edge. You can't OR edges together, so UIRectEdgeAll
won't work.
附带说明:您必须为每条边创建一个gestureRecognizer。你不能 OR 边在一起,所以UIRectEdgeAll
不起作用。
回答by Bruno Bieri
On Simulator Version 11.4 I see the option
在模拟器版本 11.4 我看到选项
Window
->Show Device Bezels
Window
->Show Device Bezels
which shows a virtual device frame around the simulated phone.
它显示了模拟手机周围的虚拟设备框架。
This allows to start the gesture "outside" of the screen. I could successfully trigger a UIScreenEdgePanGestureRecognizer
from the left.
这允许在屏幕“外部”开始手势。我可以成功地UIScreenEdgePanGestureRecognizer
从左边触发 a 。