PQMenuBar 是 iOS 应用程序的轻量级菜单栏。
menu = [[PQMenuBar alloc] initWithFrame:CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, 180)];
PQMenuBarItem *itemA = [[PQMenuBarItem alloc] initWithTitle:@"testA"
image:[UIImage imageNamed:@"photo"]
target:self
action:@selector(actionA:)];
PQMenuBarItem *itemB = [[PQMenuBarItem alloc] initWithTitle:@"testB"
image:nil
target:self
action:@selector(actionB:)];
[menu addMenuItem:itemA];
[menu addMenuItem:itemB];
设置列和行,默认列数 = 4,行数 = 2
[menu setColumn:3 andRow:3];
设置隐藏分页,默认为 NO
[menu hidePaging:YES];
显示菜单
[menu show];
关闭菜单
[menu dismiss];
menu.delegate = self;
可以实施的方法
- (void)menuBar:(PQMenuBar *)menubar didSelectAtIndex:(int)index;
要运行示例项目,首先克隆仓库,然后从 Example 目录运行 pod install
PQMenuBar 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "PQMenuBar"
pqteru, [email protected]
PQMenuBar 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。