Seems like a really simple issue, but I haven't found a solution yet:
I have an UIDatePicker
that shows when a certain table view cell is selected. I display it with the following code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 1) {
switch (indexPath.row) {
case 0: {
_alarmPicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 315, 320, 0)];
[_alarmPicker setDatePickerMode:UIDatePickerModeTime];
[_alarmPicker addTarget:self action:@selector(alarmPickerChanged) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:_alarmPicker];
}
break;
default:
break;
}
}
}
The problem is, whenever the picker is displayed, it scrolls upward and downward with the rest of the table. Beyond simply disabling all scrolling on the table view when the picker is selected, how can I keep the picker fixed but the table scrollable?