views:

537

answers:

1

Hi,

For one of UITableView sections I have put a view with a UIDatePicker into it's footer (using tableview:viewForFooterInSection:). The problem is that UIDatePicker receives only single touch events (tapping) and doesn't receive scroll events, so I am unable to set appropriate time inside it. Instead of scrolling UIDatePicker's hours or minutes spinners, UITableView scrolls.

How can I make UIDatePicker respond to user "drag" events and make it spin instead of scrolling UITableView?

A: 

Hi,

You can subclass UITableViewCell and then add UIDatePicker view as a subview on that subclassed UITableViewCell. Then you will get the way your requirement is.

As example.

UIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:self.frame];
[self addSubview:datePicker];
[datePicker release];

Here self refers to UITableViewCell subclass object.

Jalan