Skip to content

头部分组菜单,功能类似于UISegmentControl或者UITabBarController

License

Notifications You must be signed in to change notification settings

wzf/FEHeaderMenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FEHeaderMenu

头部分组菜单,功能类似于UISegmentControl或者UITabBarController

image image

更新

每个菜单项,增加“警告标记”

  • (void)showWarning:(BOOL)showOrNot AtIndex:(NSInteger)index;

##tag 当前tag ~> 0.0.3

##Pod pod 'FEHeaderMenu'

##用法: NSArray *titles = @[@"未读",@"已读",@"垃圾箱"];

// set appearance color
[[FEHeaderMenu appearance] setItemTitleNormalColor:[UIColor blueColor]];
[[FEHeaderMenu appearance] setItemTitleSelectedColor:[UIColor redColor]];
[[FEHeaderMenu appearance] setMarkViewColor:[UIColor greenColor]];
[[FEHeaderMenu appearance] setWarningViewColor:[UIColor orangeColor]];

// init
__weak typeof(self) weakSelf = self;
FEHeaderMenu *headMenu = [FEHeaderMenu menuWithTitleAtIndex:^NSString *(NSInteger index, BOOL *isStop) {
    if (index == titles.count-1) {
        *isStop = YES;
    }
    return titles[index];
    
} clickAtIndex:^(FEHeaderMenu *menu, NSInteger index, NSString *title) {
    // remove warning 
    [menu showWarning:NO AtIndex:index];
    // do something else
    //[weakSelf reloadTableViewData:title];
}];  

##说明:

  1. 菜单项小于4个的,全部展示,菜单不滚动。
  2. 菜单多余4个的,最多展示4个,超出部分依次往后排列,通过滑动展示。
  3. 标记红条,跟随menuItem滚动
  4. 带有警告标记,类似于“新消息提示”

About

头部分组菜单,功能类似于UISegmentControl或者UITabBarController

Resources

License

Stars

Watchers

Forks

Packages

No packages published