2011-06-08 67 views
0

对于我来说,允许用户从UITableViewCell中选择一个月的最佳方式是什么? UIPickerView需要高度非常大,这使得它看起来很丑。还有其他一些选择吗?我不想在那里放置文本字段,并手动让用户输入一个月.. 谢谢。从UITableViewCell的列表中选择月份?

+0

UIPickerView仅占用屏幕的35%...与键盘大小相同。这是选择日期的最佳视图,并为用户提供了令人敬畏的体验。 – Legolas 2011-06-08 19:28:50

+0

那么如何显示UIPickerView而不是UIKeyboard? – BukLau 2011-06-08 20:48:37

+0

...检查答案 – Legolas 2011-06-08 20:53:40

回答

0
UIDatePicker *datePicker = [[UIDatePicker alloc] init]; 
datePicker.datePickerMode = UIDatePickerModeDate; 
[datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged]; 
datePicker.tag = indexPath.row; 
textField.delegate= self; 

textField.inputView = datePicker; // Now the Keyboard will not appear // 

[datePicker release]; 
+0

谢谢胸罩,我在找什么... – BukLau 2011-06-08 21:01:16

+1

呃........胸罩? – Legolas 2011-06-08 21:03:03

+0

1)与“bro”同义, – BukLau 2011-06-08 21:56:59