OGeek|极客世界-中国程序员成长平台

标题: ios - SideMenu 未使用屏幕的整个高度 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 20:13
标题: ios - SideMenu 未使用屏幕的整个高度

我正在使用 this library使用 Swift 4 在 iOS 中创建侧边菜单。

但是,这仅适用于 iPhone SE 或 5S 等较小的屏幕。在 iPhone 6 等更大的屏幕上,这不起作用,因为侧边菜单不会一直延伸到屏幕底部:

screenshot of side menu that doesn't go all the way down

我在 MainViewController 中创建侧边菜单的代码:

let menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as! UISideMenuNavigationController
SideMenuManager.default.menuWidth = 260 
SideMenuManager.default.menuLeftNavigationController = menuLeftNavigationController
SideMenuManager.default.menuFadeStatusBar = false
SideMenuManager.default.menuPresentMode = .menuSlideIn
SideMenuManager.default.menuAnimationFadeStrength = 0.5
SideMenuManager.default.menuShadowOpacity = 0.8

// open with present
self.present(SideMenuManager.default.menuLeftNavigationController!, animated: true, completion: nil)

带有 SideMenu 的 ViewController:

storyboard screenshot



Best Answer-推荐答案


尝试设置前导、顶部、底部和宽度约束。

关于ios - SideMenu 未使用屏幕的整个高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50710699/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4