2013-05-16 32 views
1

我看到了iOS的Facebook應用程序更新(6.1.1),它具有良好的回退功能。現在我有一個UISlideGestureRecognizer,當時被稱爲一個[self.navigationController popViewController:YES];。但是我怎樣才能在Facebook應用中使用UIPanGestureRecognizer呢?我應該建立自己的UINavigationController嗎?在UINavigationController中滑回像iOS中的Facebook

我不知道比這更(還):

backView1 = [[self.navCon.viewControllers objectAtIndex:self.navCon.viewControllers.count - 2] view]; 
backView2 = [[self.navCon.viewControllers objectAtIndex:self.navCon.viewControllers.count - 1] view]; 

請提前幫助!

UPDATE:

截圖: enter image description here

+0

首先我從來沒有聽說過''UISlideGestureRecognizer :))的。第二個檢查這個項目https://github.com/edgecase/ECSlidingViewController – danypata

+0

我的意思是UISwipeGestureRecongnizer :) –

回答

0

如果你談論的是滑出菜單中可以部分地 '刷卡',看到這幾個例子。

SplitView like Facebook app on iPhone

+0

不,我更多地討論:當你在新聞採訪中,然後觸摸一個故事(Facebook應用程序顯示的故事一些代碼lik:[self,navigationController pushViewController:con];)然後,當你想返回時,你現在可以從左到右滑動你的手指回到新聞提要。理解? –

0

要添加幻燈片的效果早在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; 
} 
相關問題