I have a UITextField
and a UIDatePicker
in my XIB file, now I assigned the date that is chosen on the UIDatePicker
to be the value of the text in my textfield. I've done this well, my only problem now is that I want the keyboard not to show when I tap on the textfield.
I'm sure somebody knows the answer, I will be glad if you will share it :) Thanks!
btw. I tried this, but it didn't work..
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
[textField resignFirstResponder];
}
You can set delegate in your UITextField
and return NO
in textFieldShouldBeginEditing
.
Just set the UIDatePicker
as the inputView of your UITextField
.
This wil repalce the keyboard as the input view when the user clicks on the UItextField
with the UIDatePicker
.
self.dateTextField.inputView = self.datePicker;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With