TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2016 |
Maintained by jidibingren.
Depends on: | |
Masonry | ~> 0.6.4 |
BlocksKit | ~> 2.2.5 |
公司项目中通用下拉菜单集成,参考了KTDropdownMenuView,在理清思路和需求后完成了DTKDropdownMenu,感谢
__weak typeof(self) weakSelf = self;
DTKDropdownItem *item0 = [DTKDropdownItem itemWithTitle:@"rightItem0" iconName:@"DTK_jiangbei" callBack:^(NSUInteger index, id info) {
NSLog(@"rightItem%lu",(unsigned long)index);
[weakSelf push];
}];
DTKDropdownItem *item1 = [DTKDropdownItem itemWithTitle:@"rightItem1" iconName:@"DTK_renwu" callBack:^(NSUInteger index, id info) {
NSLog(@"rightItem%lu",(unsigned long)index);
[weakSelf push];
}];
DTKDropdownItem *item2 = [DTKDropdownItem itemWithTitle:@"rightItem2" iconName:@"DTK_update" callBack:^(NSUInteger index, id info) {
NSLog(@"rightItem%lu",(unsigned long)index);
[weakSelf push];
}];
DTKDropdownItem *item3 = [DTKDropdownItem itemWithTitle:@"rightItem3" iconName:@"DTK_xiaoxi" callBack:^(NSUInteger index, id info) {
NSLog(@"rightItem%lu",(unsigned long)index);
[weakSelf push];
}];
DTKDropdownMenuView *menuView = [DTKDropdownMenuView dropdownMenuViewWithType:dropDownTypeRightItem frame:CGRectMake(0, 0, 44.f, 44.f) dropdownItems:@[item0,item1,item2,item3] icon:@"DTK_bi"];
menuView.dropWidth = 150.f;
menuView.titleFont = [UIFont systemFontOfSize:18.f];
menuView.textColor = ColorWithRGB(102.f, 102.f, 102.f);
menuView.textFont = [UIFont systemFontOfSize:13.f];
menuView.cellSeparatorColor = ColorWithRGB(229.f, 229.f, 229.f);
menuView.textFont = [UIFont systemFontOfSize:14.f];
menuView.animationDuration = 0.2f;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:menuView];