//添加控件 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.view.backgroundColor = [UIColor whiteColor]; chooseItems = [[NSArray alloc]initWithObjects: [NSArray arrayWithObjects:@"不限条件",@"条件1",@"条件2",@"条件3",@"条件4",@"条件5", nil], [NSArray arrayWithObjects:@"不限国度",@"中国",@"米国",@"岛国",@"大清国",@"大宋国",@"星星国",@"阿里国", nil], [NSArray arrayWithObjects:@"不限",@"男",@"女",@"不男不女", nil],nil]; DropDownChooseView *chooseView = [[DropDownChooseView alloc]initWithFrame:CGRectMake(0, 20, 320, 44) dataSource:self delegate:self]; chooseView.mSuperView = self.view; [self.view addSubview:chooseView]; } //控件数据源设定和回调设定 #pragma mark - DropDownChooseView dataSoure and Delegate -(NSInteger)numberOfSections{ return [chooseItems count]; } -(NSInteger)numberOfRowsInSection:(NSInteger)section{ return [[chooseItems objectAtIndex:section] count]; } -(NSString *)titleInSection:(NSInteger)section index:(NSInteger)index{ return [[chooseItems objectAtIndex:section] objectAtIndex:index]; } -(NSInteger)defaultShowIndexInSection:(NSInteger)section{ return 0; } -(void)choosedAtSection:(NSInteger)section index:(NSInteger)index{ NSLog(@"choosed at section:%d index:%d, content:%@",section,index,[[chooseItems objectAtIndex:section] objectAtIndex:index]); }
热门文章更多>>
标签更多>>
专题更多>>
最新文章更多>>
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源
- 使用 C# 6.0 功能运行 TFS 构建