Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

seVor

macrumors newbie
Original poster
Aug 20, 2008
4
0
I know its a dumb question but how can I change the return button on the keyboard to done?
 

sgauravv

macrumors newbie
Jul 17, 2008
12
0
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.
 

seVor

macrumors newbie
Original poster
Aug 20, 2008
4
0
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.
 

TeeJayEm

macrumors regular
Mar 28, 2008
104
0
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.

you need to implement the following.
Code:
-(BOOL) textFieldShouldReturn:(UITextField *)textField

Ex:
Code:
-(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;
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.