示例代码:
NSArray *dataSource = @[@"iOS",@"Java",@"PHP"];ISGDropDownList *workStatus = [[ISGDropDownList alloc] initWithFrame:CGRectMake(20, 100, 300, 30)];// 设置数据源workStatus.listItems = dataSource;// 边框颜色workStatus.borderColor = [UIColor lightGrayColor];// 边框宽度workStatus.borderWidth = 1.0f;// 设置最大列数workStatus.maxRows = dataSource.count;// 圆角workStatus.cornerRadius = 5;// 背景颜色workStatus.comBackgroundColor = [UIColor whiteColor];// 默认标题workStatus.defaultTitle = @"请选择专业:";// 标题大小workStatus.titleSize = 14;// 下拉选中的blockworkStatus.ClickDropDown = ^(NSInteger index){ NSLog(@"选择了-------------:%@",dataSource[index]);};[self.view addSubview:workStatus];点击空白处退出提示
评论