I have an issue related to hide and show the datepicker view when click on textfield...Actually I have 2 textfields..Here is my problem image...
Problem
Batter to use date picker as input view
UIView *viewDateInput = [[UIView alloc] initWithFrame:CGRectMake(0, 0,[UIScreen mainScreen].bounds.size.width, 200)];
[viewDateInput setBackgroundColor:[UIColor whiteColor]];
self.pickerDate = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, viewDateInput.frame.size.width, viewDateInput.frame.size.height)];
self.pickerDate.datePickerMode = UIDatePickerModeDate;
[viewDateInput addSubview:self.pickerDate];
[self.pickerDate addTarget:self action:@selector(dateChanged:) forControlEvents:UIControlEventValueChanged];
[self.txtDate setInputView:viewDateInput];
Function For date Change
- (void)dateChanged:(id)sender
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
NSString *currentTime = [dateFormatter stringFromDate:self.pickerDate.date];
self.txtDate.text = currentTime;
}