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.
This is what I have done:
- (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 are populating the UITextField based on the UIPicker, why not simply disable user interaction with the UITextField? You can still put data there and the user will not be able to change it. To force the keyboard to stay hidden however, you can make the UITextField detect when it is touched/changed/etc and then have it resign first responder.