有人可以说明(或指向一个很好的教程)如何以编程方式将日期选择器添加到视图中(即,不使用界面编辑器)?
这是非常容易的人.你可以在几秒钟内完成.
只需在your.m文件中使用这些方法......一切准备就绪
- (void)viewDidLoad { CGRect pickerFrame = CGRectMake(0,250,0,0); UIDatePicker *myPicker = [[UIDatePicker alloc] initWithFrame:pickerFrame]; [myPicker addTarget:self action:@selector(pickerChanged:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:myPicker]; [myPicker release]; } - (void)pickerChanged:(id)sender { NSLog(@"value: %@",[sender date]); }