UIDatePicker's wheel is not displayed correctly while scrolling. This problem occurs if I hide UIDatePicker Controller or navigate in another screen.
Asked
Active
Viewed 510 times
0
-
does this behaviour appear when you scroll or when the datapicker just opens? – Kees Sonnema Apr 10 '13 at 12:39
-
Do u wanna either current date or you wanna reload your picker view. – Dharmbir Singh Apr 10 '13 at 12:46
-
when i m scrolling datepicker's wheel.and i just hide a date picker controller at a time. – Sonu Apr 10 '13 at 12:47
-
Couldn't get you.. Can you please explain a bit ? – Manu Apr 10 '13 at 15:12
2 Answers
0
You can do it in two way 1. Using gesture recogniser. 2.You can add target like this ..
First add target in viewDidLoad.
[datePicker addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
- (void)valueChanged
{
// --- you can hide your picker view here
[datePicker setHidden:YES];
}

Dharmbir Singh
- 17,485
- 5
- 50
- 66
-1
In viewWillAppear or viewDidAppear, try setting the date, it looks as if the animation was halted, this should reset the location:
[picker setDate:[picker date] animated:NO];

user352891
- 1,181
- 1
- 8
- 14