MBBarMenu 0.1.5

MBBarMenu 0.1.5

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2015年2月

Max Bothe维护。



MBBarMenu 0.1.5

  • Max Bothe

MBBarMenu 简化了在 iOS UINavigationBar 中多个 UIBarButtonItems 的排列。在给定的数量下,这些项目将被正常显示。如果项目数量超过这个阈值,所有剩余的项目将显示在 UIAlertView 中。

在 iPhone 上

MBBarMenu Example Phone MBBarMenu Example Phone 2

在 iPad 上

MBBarMenu Example Pad

安装

手动

  • 将 MBBarMenu 目录复制到您的项目中

入门

设置视图控制器

  • 继承 MBBarMenuViewController
  • 视图控制器必须放在一个 UINavigationController

添加菜单项

建议在视图控制器加载时设置这些项,例如:在 initWithCoder:viewDidLoad: 中。然而,新项目一旦添加到 MBBarMenuViewController,将立即显示。示例

- (void)viewDidLoad
{
    [super viewDidLoad];

    MBBarMenuItem *item = [[MBBarMenuItem alloc] initWithTitle:@"Foo" target:self action:@selector(bar)];
    [self addBarMenuItem:item];
}

自定义

MBBarMenuViewController

  • maximumItemCountPhone:iPhone 上导航栏的菜单项最大数量(默认:1)
  • maximumItemCountPad:iPad 上导航栏的菜单项最大数量(默认:4)
  • menuHidden:指示菜单是否显示(默认:false)

MBBarMenuItem

  • title:在导航栏或提示控制器中显示的项的文本(必需)
  • action:选择项后要触发的事件(必需)
  • target:事件接收器(必需)
  • image:代替导航栏中的文本的图像;也在提示控制器中显示
  • isActivated:确定项状态的处理器 { ON | OFF }
  • titleActivated:激活状态下项的文本
  • imageActivated:激活状态下项的图像

许可证

The MIT License (MIT)

Copyright (c) 2014 Max Bothe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.