<code id="ymukc"><xmp id="ymukc">

iOS全屏滑動代碼

usib8630的頭像 usib8630 0 2016-03-05 20:36 0

 基本信息

× 1   

瀏覽數: 23059

分享時間: 2 年 前

2
- (void)viewDidLoad {
    [super viewDidLoad];   
     // 獲取系統自帶滑動手勢的target對象
    id target = self.interactivePopGestureRecognizer.delegate; 
       // 創建全屏滑動手勢,調用系統自帶滑動手勢的target的action方法
    UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)];    // 設置手勢代理,攔截手勢觸發
    pan.delegate = self;   
     // 給導航控制器的view添加全屏滑動手勢
    [self.view addGestureRecognizer:pan];   
     // 禁止使用系統自帶的滑動手勢
    self.interactivePopGestureRecognizer.enabled = NO;

}
// 什么時候調用:每次觸發手勢之前都會詢問下代理,是否觸發。
// 作用:攔截手勢觸發
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{    // 注意:只有非根控制器才有滑動返回功能,根控制器沒有。
    // 判斷導航控制器是否只有一個子控制器,如果只有一個子控制器,肯定是根控制器
    if (self.childViewControllers.count == 1) {       
     // 表示用戶在根控制器界面,就不需要觸發滑動手勢,
        return NO;
    }    return YES;
}



12 [下一頁]

  • cixexey的頭像 cixexey 2018-06-22 23:11 代碼數:0

    This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post.

    ????? ?????

  • cixexey的頭像 cixexey 2018-06-24 18:39 代碼數:0

    I would like to say that this blog really convinced me to do it! Thanks, very good post.

    KFZ Widerruf

  • cixexey的頭像 cixexey 2018-06-27 18:56 代碼數:0

    I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! appellate lawyers Georgia

  • cixexey的頭像 cixexey 2018-06-30 16:39 代碼數:0

    Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place..cryptocurrency game

  • cixexey的頭像 cixexey 2018-05-14 19:21 代碼數:0

    I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks.click here

  • cixexey的頭像 cixexey 2018-05-14 19:22 代碼數:0

    Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks click here

  • cixexey的頭像 cixexey 2018-06-30 19:18 代碼數:0

    Thanks for your information, it was really very helpfull..a course in miracles

  • cixexey的頭像 cixexey 2018-07-01 22:09 代碼數:0

    I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! acim

     

  • cixexey的頭像 cixexey 2018-07-02 16:00 代碼數:0

    I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!..acim

  • Fatpac的頭像 Fatpac 2018-07-14 18:47 代碼數:0

    I'm agree with Cixexey, this info is useful to me too, thank you to have posted this, i was searching this for days. agence de communication dijon netref

您的評論:

  
六合特码资料
<code id="ymukc"><xmp id="ymukc">
<code id="ymukc"><xmp id="ymukc">