In my application I have to fill UITextField
from the value exist in UIPickerView
not through keyboard.
I have 2 UITextFields
.
In 1st textfield value is fetched from keyboard
and in 2nd textfield value is fetched from UIPickerView
so on tapping 2nd textfield I want to hide keyboard and show UIPickerView
here I add what I do for your better reference
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
[pickerToolBar setHidden:NO];//shows toolbar
[pickerTime setHidden:NO];//shows UIPickerView
[textField resignFirstResponder];
}
but after writing the above code the keyboard does not disappear.
if you have any idea then plz help me...
You can ask the system to dismiss the keyboard by calling the resignFirstResponder method of your text field. Usually, you dismiss the keyboard in response to specific interactions. For example, you might dismiss the keyboard when the user taps the keyboard's return key.
Try UITextfield
delegate methods. put the following code in texfield didBeginEditing
method.
[texfield resignfirstresonder];
Then the text field will block editing and keyboard will not appear. Make sure you attached the text field delegate to the file owner.
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