0

UIDatePicker's wheel is not displayed correctly while scrolling. This problem occurs if I hide UIDatePicker Controller or navigate in another screen.

enter image description here

Brian
  • 14,610
  • 7
  • 35
  • 43
Sonu
  • 937
  • 1
  • 10
  • 39

2 Answers2

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