效果圖如下:
yyy.png
調(diào)用方法很簡(jiǎn)單:
- (void)viewDidLoad {
[super viewDidLoad];
NSArray *titlesArr = @[@[@"綜合排序",@"新品優(yōu)先",@"評(píng)論數(shù)從高到低"],
@[@"品牌",@"國(guó)內(nèi)品牌",@"國(guó)際品牌"],
@[@"顏色",@"黑色",@"黃色",@"白色",@"藍(lán)色"]];
XMDropDownChooseView *chooseView = [[XMDropDownChooseView alloc]initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, 40) dataArr:titlesArr delegate:self];
chooseView.titleColor = [UIColor redColor];
[self.view addSubview:chooseView];
}
-(void)choosedAtSection:(NSInteger)section index:(NSInteger)index
{
NSLog(@"section:%lu------index:%lu",section,index);
}