开发者

Pick month from a list in UITableViewCell?

开发者 https://www.devze.com 2023-03-11 18:42 出处:网络
What\'s the best way for me to allow the user to pick a month from a UITableViewCell? UIPickerView requires the height to be very large which makes it look ugly..What are some other options? I don\'t

What's the best way for me to allow the user to pick a month from a UITableViewCell? UIPickerView requires the height to be very large which makes it look ugly..What are some other options? I don't want to pu开发者_JAVA技巧t a text field there and manually make the user enter a month.. Thanks.


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

精彩评论

暂无评论...
验证码 换一张
取 消