类似美团的多级下拉选择菜单 -500行实现
查看次数:18774
下载次数:2972
上传时间:2015-08-10
大小:223 B
类似美团的多级选择列表 - 简单易用
(史上最简洁的 三级列表 ,并且很容易改造成两级和一级或者四级,实现代码不超过550行);
初始化对象
``` OC
WSDropMenuView *dropMenu = [[WSDropMenuView alloc] initWithFrame:CGRectMake(0, 60, self.view.frame.size.width, 40)];
dropMenu.dataSource = self;
dropMenu.delegate =self;
[self.view addSubview:dropMenu];
```
实现代理方法 (简单易用 , 不繁琐)
```OC
- (NSInteger)dropMenuView:(WSDropMenuView *)dropMenuView numberWithIndexPath:(WSIndexPath *)indexPath; //dataSource
- (NSString *)dropMenuView:(WSDropMenuView *)dropMenuView titleWithIndexPath:(WSIndexPath *)indexPath //dataSource
- (void)dropMenuView:(WSDropMenuView *)dropMenuView didSelectWithIndexPath:(WSIndexPath *)indexPath //delegate
```
测试环境:Xcode 6.2,iOS 6.0 以上
收藏