如何在 mmdrawercontroller 打开的侧边菜单上调暗 CenterController?
How to dim CenterController on Side menu open in mmdrawercontroller?
我想在抽屉在 MMDrawerController 中打开时调暗中央控制器视图,而抽屉正在关闭时逐渐取消调暗(增加子视图上的 alpha?)中央控制器。
将带有 alpha 的调光透明视图添加到视觉状态块内的中心视图控制器会产生这种效果。
let drawerController = DrawerController(centerViewController: nav, leftDrawerViewController: SideMenuTableViewController())
let blurView = UIView(frame: UIScreen.mainScreen().bounds)
blurView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.4)
drawerController.drawerVisualStateBlock = { (drawer, drawerSide, percentVisible) in
if percentVisible > 0 && blurView.superview == nil {
drawerController.centerViewController?.view.addSubview(blurView)
}
if percentVisible == 0 {
blurView.removeFromSuperview()
}
}
我想在抽屉在 MMDrawerController 中打开时调暗中央控制器视图,而抽屉正在关闭时逐渐取消调暗(增加子视图上的 alpha?)中央控制器。
将带有 alpha 的调光透明视图添加到视觉状态块内的中心视图控制器会产生这种效果。
let drawerController = DrawerController(centerViewController: nav, leftDrawerViewController: SideMenuTableViewController())
let blurView = UIView(frame: UIScreen.mainScreen().bounds)
blurView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.4)
drawerController.drawerVisualStateBlock = { (drawer, drawerSide, percentVisible) in
if percentVisible > 0 && blurView.superview == nil {
drawerController.centerViewController?.view.addSubview(blurView)
}
if percentVisible == 0 {
blurView.removeFromSuperview()
}
}