Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-04-2009, 09:34 AM   #1 (permalink)
shabzcohelp
Registered Member
 
Join Date: May 2009
Posts: 44
shabzcohelp is on a distinguished road
Exclamation I need help getting my keyboard to retract(disappear)

I know this has been mentioned many times in this forum, but I have searched and could not get any of them to work.

I need a code to have my keyboard go back down after the user presses the return button or touches somewhere else on the screen. This code needs to be all programmatic as I did not use Interface Builder for this. I hope someone can help.

here is my code in the .m file
Code:
- (void)viewDidLoad {
	CGRect frame = CGRectMake(20.0, 68.0, 280.0, 31.0);
	UITextField *textField = [[UITextField alloc] initWithFrame:frame];
	
	self.string = textField.text;
	

	
    textField.textAlignment = UITextAlignmentLeft;
	
    textField.borderStyle = UITextBorderStyleBezel;

	
    textField.autocapitalizationType = UITextAutocapitalizationTypeSentences;
	
    textField.keyboardType = UIKeyboardTypeAlphabet;
	
    textField.returnKeyType = UIReturnKeyDefault;
	
	textField.textColor = [UIColor redColor];
	[textField resignFirstResponder];
	
    [self.view addSubview:textField];
Thanks in advance
shabzcohelp is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,636
Threads: 94,101
Posts: 402,809
Top Poster: BrianSlick (7,990)
Welcome to our newest member, samdanielblr
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:07 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.