UIPickerView 作为iOS的一个常用控件相信大家都有这方面的需求
今天我们就简单创建一个
新建项目 命名:TestUIPickerView
在默认生成的ViewController中创建UIPickerView
首先在viewDidLoad 的方法中创建
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// 选择框
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 100, 320, 216)];
// 显示选中框
pickerView.showsSelectionIndicator=YES;
pickerView.dataSource = self;
pickerView.delegate = self;
[self.view addSubview:pickerView];
_proTimeList = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",nil];
_proTitleList = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",@"4