文章来源:淘论文网   发布者: 毕业设计   浏览量: 38



还可以点击去查询以下关键词:
[菜单]    [目录]    [菜单目录]   

项目介绍:

Usage

// initialize menu data

NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@'district' ofType:@'json']]; NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil]; NSDictionary *realData = jsonDic[@'data']; RicDistrictMenu *rootDataModel = [RicDistrictMenu new]; [rootDataModel setValuesForKeysWithDictionary:realData]; RicMenuItem *rootItem = [[RicMenuItem alloc] initWithDelegate:self oriData:rootDataModel defaultSelections:nil]; _menuView = [[RicMenuView alloc] initWithFrame:RicBaseFilterViewContentBounds]; [_menuView setDelegate:self rootItem:rootItem]; [self.view addSubview:_menuView]; // get the result NSArray *result = _menuView.filteredLeafMenuItems; // delegates - (void)filterMenuDidClickedItem:(RicMenuItem *)item { // for clicking the item in the menu } - (BOOL)supportMutiSelectionForItem:(RicMenuItem *)item{ // for selection enable if(item.allSubMenusAreLeaves){ return YES; }else{ return NO; } } - (void )configTableViewAtDepth:(NSInteger)depth tableView:(UITableView *)tableView { UIColor *bgColor = [UIColor whiteColor]; if(depth == 0){ bgColor = [UIColor colorWithRed:243.0f/255.0f green:243.0f/255.0f blue:243.0f/255.0f alpha:1.0f]; }else if(depth == 1){ bgColor = [UIColor colorWithRed:113.0f/255.0f green:133.0f/255.0f blue:153.0f/255.0f alpha:1.0f]; } tableView.backgroundColor = bgColor; } // 返回一个偏移量给tableView - (CGFloat )widthOfTableViewOfMenu:(RicMenuItem *)menu { CGFloat width = [UIScreen mainScreen].bounds.size.width/3.0f; return width; } // 这个代理方法需要指定 filterController的 heightForRowAtIndexPath 和 tableViewCellClass 两个属性 // config the MenuController - (void)configControllerOfMenu:(RicMenuItem *)menu controller:(RicMenuController *)controller { RicMenuController *subMenuController = controller; subMenuController.heightForRowAtIndexPath = ^CGFloat(NSInteger depth,NSIndexPath *indexPath,RicMenuItem *subMenu){ if(depth == 0){ return 50.0f; }else if(depth == 1){ return 60.0f; }else{ return 40.0f; } }; if(menu.depth == 0){ subMenuController.tableViewCellClass = [RicMenuDepth0Cell class]; }else if(menu.depth == 1){ if([menu.tag isEqualToString:@'location_district']){ subMenuController.tableViewCellClass = [RicMenuDepth1Cell class]; }else{ subMenuController.tableViewCellClass = [RicMenuDepth2Cell class]; } }else if (menu.depth == 2){ subMenuController.tableViewCellClass = [RicMenuDepth2Cell class]; } } // add actions for your cells // cell 动作 - (void)configureActionsForCell:(UITableViewCell *)cell{ NSLog(@'configure cell here'); } Integration:

To integrate the control use Cocoapods add the line below into your Podfile:

pod:'RicMenuView','~>0.0.1'

论文开题报告

这里还有:


还可以点击去查询:
[菜单]    [目录]    [菜单目录]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/4524.docx
  • 上一篇:UISlider调控自定义progress
  • 下一篇:仿写百思不得姐