I have written this code. When I click the text field, the keyboard does not appear.
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
if (textField==urlTxtFld) {
CGRect newBounds = urlTxtFld.bounds;
GoogleTxtFld.hidden=YES;
//[urlTxtFld setFrame:CGRectMake(0, 0, 320, 40)];
newBounds.size.width = 320; //whatever you want the new width to be
[UIView beginAnimations:nil context:nil];
urlTxtFld.bounds = newBounds;
[UIView commitAnimations];
}return YES;
}
The problem is that
textFieldis asking from its delegate (if you have set it properly) ‘Should I begin editing?'[ this method will be called-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField]. But you are not saying anything to it, neither YES nor NO, so it got confused and it decided to keep quit(By not showing keyboard).To show keyboard, you will need to return ‘
YES‘ in this delegate method.