iOS抽屜效果,ios抽屜

來源:互聯網
上載者:User

iOS抽屜效果,ios抽屜

源碼下載

抽屜效果第三方類庫下載

所需第三方類庫下載

側拉欄抽屜

        


需要匯入的標頭檔:

#import "MMDrawerController.h"#import "MMExampleDrawerVisualStateManager.h"
代碼實現:

首先需要建立三個試圖控制器

//主視圖    FirstViewController *firstVC = [[FirstViewController alloc] init];    //左邊視圖    SecondViewController *secondVC = [[SecondViewController alloc] init];    //右邊視圖    ThirdViewController *thirdVC = [[ThirdViewController alloc] init];        CustomizedNavigationController *navigationVC = [[CustomizedNavigationController alloc] initWithRootViewController:firstVC];        CustomizedNavigationController *leftNavigationVC = [[CustomizedNavigationController alloc] initWithRootViewController:secondVC];    CustomizedNavigationController *rightNavigationVC = [[CustomizedNavigationController alloc] initWithRootViewController:thirdVC];    //抽屜管理 第三方    //該第三方既可以只實現開啟左側欄也可以實現開啟右側欄,還可以同時都實現    MMDrawerController *rooVC = [[MMDrawerController alloc] initWithCenterViewController:navigationVC leftDrawerViewController:leftNavigationVC rightDrawerViewController:rightNavigationVC];        //只實現開啟左側欄    //MMDrawerController *rooVCLeft = [[MMDrawerController alloc] initWithCenterViewController:navigationVC leftDrawerViewController:firstVC];    //只實現開啟右側欄    //MMDrawerController *rooVCRight = [[MMDrawerController alloc] initWithCenterViewController:navigationVC rightDrawerViewController:thirdVC];        //指定window的根視圖    self.window.rootViewController = rooVC;    //測了門的寬度    [rooVC setMaximumLeftDrawerWidth:270];    //設定側拉門開與關的動畫    [rooVC setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];    [rooVC setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];    //側開內容展示效果    //設定向左滑動開啟右側欄    [[MMExampleDrawerVisualStateManager sharedManager] setRightDrawerAnimationType:MMDrawerAnimationTypeNone];    //設定向右滑動開啟左側欄    [[MMExampleDrawerVisualStateManager sharedManager] setLeftDrawerAnimationType:MMDrawerAnimationTypeNone];        [rooVC setDrawerVisualStateBlock:^(MMDrawerController *drawerController, MMDrawerSide drawerSide, CGFloat percentVisible) {        MMDrawerControllerDrawerVisualStateBlock block;        block = [[MMExampleDrawerVisualStateManager sharedManager]                 drawerVisualStateBlockForDrawerSide:drawerSide];        if(block){            block(drawerController, drawerSide, percentVisible);        }    }];





iOS中怎實作類別似網易ios用戶端那樣的抽屜互動菜單

類似網易的互動網上有專門的Demo,PPRevealSideViewController
 
ios抽屜效果 怎判斷抽屜的外部地區?怎去掉拖拽效果協助

可以將你的抽屜放在一個view中,就可以知道當前view在你的Vc的座標位置,你可以判斷離開這個地區不可用 查看原帖>>
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.