测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
Released最新版本 | 2016年7月 |
由 jidibingren 维护。
依赖于 | |
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];