Iphone 滑回iOS版Facebook中的UINavigationController
我看到了针对iOS(6.1.1)的Facebook应用程序更新,它有一个很好的滑回功能。现在我有一个Iphone 滑回iOS版Facebook中的UINavigationController,iphone,ios,uinavigationcontroller,uigesturerecognizer,Iphone,Ios,Uinavigationcontroller,Uigesturerecognizer,我看到了针对iOS(6.1.1)的Facebook应用程序更新,它有一个很好的滑回功能。现在我有一个UISlidegestureRecognitor,当它被称为do a[self.navigationController popViewController:YES]时。但是,我如何使用Facebook应用程序中的UIPangestureRecognitor来实现这一点呢?我是否应该构建自己的UINavigationController 除此之外,我还不知道更多: 请提前帮忙 更新: 截图: 如果
UISlidegestureRecognitor
,当它被称为do a[self.navigationController popViewController:YES]时代码>。但是,我如何使用Facebook应用程序中的UIPangestureRecognitor
来实现这一点呢?我是否应该构建自己的UINavigationController
除此之外,我还不知道更多:
请提前帮忙
更新:
截图:
如果您谈论的是滑出式菜单,您可以部分“滑动”,请参阅以下示例
为此,我创建了UINavigationController的一个子类。现在开始:要在UINavigationController中添加滑回效果,请添加以下代码行并添加手势识别器代理
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
return YES;
}
首先,我从未听说过uislidegesturecognitioner
:))。第二,检查这个项目,我是说UISweepGestureRecongnizer:)不,我说的更多的是:当你在新闻提要中,然后触摸一个故事(Facebook应用程序用一些代码显示这个故事,比如:[self,navigationController pushViewController:con];)然后,当你想返回时,你现在可以从左向右滑动手指返回新闻提要。明白吗?
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
return YES;
}