我MMdrawercontroller
在我的 Objective-C 应用程序中使用来显示左侧菜单。我想在打开菜单时,启用对 centerVC 显示的小部分的点击。
我怎样才能做到这一点?
我MMdrawercontroller
在我的 Objective-C 应用程序中使用来显示左侧菜单。我想在打开菜单时,启用对 centerVC 显示的小部分的点击。
我怎样才能做到这一点?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
// Suppose you have three ViewContollers
// Left , Front and Right
let frontView = frontview(nibName: "frontview" , bundle: nil)
let leftView = leftview(nibName: "leftview" , bundle: nil)
let rightView = rightview(nibName: "rightview" , bundle: nil)
let mmDrawerController = MMDrawerController(center: frontView, leftDrawerViewController: leftView, rightDrawerViewController: rightView)
// Here you can use .all , .panningCenterView , .tapCenterView
// as per your requirements..
mmDrawerController?.openDrawerGestureModeMask = .all
mmDrawerController?.closeDrawerGestureModeMask = .all
self.window?.rootViewController = mmDrawerController
self.window?.makeKeyAndVisible()
return true
}
您必须在定义 de DrawerController 时启用手势。这段代码是 Swift,但在 ObjC 中会非常相似
centerContainer = MMDrawerController(centerViewController: self.centNav, rightDrawerViewController: rightViewController)
centerContainer!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.None
centerContainer!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningCenterView
我放了 MMOpenDrawerGestureMode.None 因为我用一个按钮打开菜单。如果您想用手势打开,您可以在该行中定义