Change return to done on keyboard

Discussion in 'iPhone/iPad Programming' started by seVor, Aug 20, 2008.

  1. macrumors newbie

    I know its a dumb question but how can I change the return button on the keyboard to done?
  2. macrumors newbie

    it is just simple
    I u r using..........NIb file then u can simply change using properties
    or if u r doing programtically
    then simply use this
    UITextView *textField = [[UITextView alloc] initWithFrame:frame];
    textField.returnKeyType = UIReturnKeyDone;

    i think now u can do.
  3. macrumors newbie

    Cool Thanks..... Oh How do you handle the done key? I have a button on my screen and I want the done key to do the same functionality.
  4. macrumors regular

    you need to implement the following.
    -(BOOL) textFieldShouldReturn:(UITextField *)textField
    -(BOOL) textFieldShouldReturn:(UITextField *)textField
    	if (textField == txtUserName) [txtPassword becomeFirstResponder]; //Set focus to password field
    	else if (textField == txtPassword) [self OnLogin: textField];     //Call OnLogin
    	return YES;

Share This Page