测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布上次发布 | 2017年7月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
Maintained by Madrit Kacabumi.
一个双面菜单,类似于 Android DrawerLayout,使用简单且可定制。只需下载它,即可立即使用,所有内容都使用 panGesture recogniser 构建;
1
MKLEGYDrawerLayout 可通过CocoaPods获取。要安装它,只需将以下行添加到Podfile中
pod "MKLEGYDrawerLayout"
import MKLEGYDrawerLayout
2.声明变量(最好是可选的)
var sideMenu : DoubleSideMenu?
// 默认菜单都是启用的
3.您需要将其创建为视图(在 viewdidLoad 中执行的步骤)
// function avaible in extension in the library
let bundle = Bundle(identifier: "org.cocoapods.MKLEGYDrawerLayout")
// function avaible in extension in the library
sideMenu = UIView.createView(attachTo: self.view, fromBundle: bundle)
// self.view for all the view controller container or into another view
I sideMenu?.setMainContentView (view : UIView, animated : Bool = false)
//no need to add constraints , they are automatically added
II sideMenu?.addLeftMenu(view : UIView, animated: Bool = false)
III sideMenu?.addRightMenu(view : UIView, animated: Bool = false)
sideMenu?.setLeftMenuWidth(width : CGFloat)
sideMenu?.setRightMenuWidth(width : CGFloat)
// do not use negative values as the will go back to default : 280
sideMenu?.setMenuDimColor(colorHexString : "#BBBBBB")
sideMenu?.disableRightMenu()
sideMenu?.disableLeftMenu()
// OR
sideMenu?.enableRightMenu()
sideMenu?.enableLeftMenu()
sideMenu?.clearLeftMenu()
//OR
sideMenu?. clearRightMenu()
//OR
// both of them :D and anything else again
sideMenu?.closeAllMenus()
sideMenu?.closeRightSideMenu()
sideMenu?.closeLeftSideMenu()
-- to open them --
sideMenu?.openLeftSideMenu()
sideMenu?.openRightSideMenu()
sideMenu?.leftSideBarIsOpen : Bool
sideMenu?.rightSideBarIsOpen : Bool
sideMenu?.leftMenuIsEnabled : Bool
sideMenu?.rightMenuIsEnabled : Bool
Madrit Kacabumi(移动开发者),[email protected]或[email protected]
MKLEGYDrawerLayout采用GPL许可证,免费供所有人使用:)