2017-03-27 46 views

回答

0

管理RTL和LTR而不关闭应用程序Swift 3.0。

// RTL

UIView.appearance()。semanticContentAttribute = .forceRightToLeft UINavigationBar.appearance()。semanticContentAttribute = .forceRightToLeft

// applicationNavigationController是应用默认导航控制器 如果让applicationNavigationController = storyboard?.instantiateViewController(withIdentifier:“root”){UIApplication.shared.keyWindow?.rootViewController = applicationNavigationContr奥勒

LTR //

UIView.appearance()semanticContentAttribute = .forceLeftToRight UINavigationBar.appearance()semanticContentAttribute = .forceLeftToRight 如果让applicationNavigationController =故事板.instantiateViewController(withIdentifier:? “根” ){ UIApplication.shared.keyWindow?.rootViewController = applicationNavigationController

//与MMDrawer交易时的其他提示。

的AppDelegate

VAR centerContainer:MMDrawerController?

在一个ViewController中实现MMDrawer代码。

let appdelegate = UIApplication.shared.delegate as! AppDelegate

let mainStoryboard:UIStoryboard=UIStoryboard(name: "Main", bundle: nil) 

    let centerViewController = mainStoryboard.instantiateViewController(withIdentifier: "HomeViewController") as! HomeViewController 
    let leftViewController = mainStoryboard.instantiateViewController(withIdentifier: "LeftSideMenuViewController") as! LeftSideMenuViewController 



    let leftSideNav = UINavigationController(rootViewController: leftViewController) 
    let centerNav = UINavigationController(rootViewController: centerViewController) 


    appdelegate.centerContainer = MMDrawerController(center: centerNav, leftDrawerViewController: leftSideNav) 

    appdelegate.centerContainer?.maximumLeftDrawerWidth = 250.0 


    appdelegate.centerContainer!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.panningCenterView 
    appdelegate.centerContainer!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.all 

    ////////// 
    self.navigationController?.pushViewController(appdelegate.centerContainer!, animated: false) 
相关问题