1
6
UIPanGestureRecognizer
UISwipeGestureRecognizer
. 实例化适当的对象,使用
|
2
1
创建一个UIScrollView add作为窗口的子视图,然后创建一个具有滑块的viewController实例,并将其添加到scrollView的子视图中。
我怀疑您没有收到事件是由于IB中缺少连接,或者scrollView正在将事件转发到newViewController视图的superview。
在苹果文档中
有几件事要尝试。
看一看这个 ScrollViewSuite 还有示例代码。 在其他答案中还讨论了新的消化器的样品。注意,guesturizer被添加到视图中,guesturizer的处理被委托给另一个对象(通常是视图的控制器) 您声明按钮和标签是作为IB中scrollview的子视图添加的。似乎您应该使用UIView作为按钮和标签的容器。只是一个想法,因为我无法从代码片段中分辨出来。
|