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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-03-2009, 06:53 PM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 2
Default Wrong UIKeyboardType

I have the following code for two text fields. The idea is that when you click the Next button on the first field it will move the cursor to the second field.

Code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
	if( textField == firstField )
	{
		// Move selection to next field
		[self.firstField endEditing:YES];
		[self.secondField becomeFirstResponder];
	}
}
All of this works as expected. However, I have recently noticed that when it switches to the second field, the keybord type changes away from what I have setup in the .xib. It works correctly when I click directly on the second field. So, I figured if I added the code below I could force the keyboard type. Unfortunately, this does not work either.

Code:
- (BOOL)textFieldDidBeginEditing:(UITextField *)textField
{
	[textField setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
	
	return YES;
}
Any ideas would be apreciated.

-Jerry
JohnnyFlash is offline   Reply With Quote
Old 01-01-2010, 02:18 PM   #2 (permalink)
Noob
 
Join Date: Dec 2008
Location: Souf London
Posts: 24
Default

Hi,

I don't suppose you had any joy solving this did you?

I have a vaguely similar case in that I have a text field in which numbers only should be entered, for which I set the UIKeyboardTypeNumbersAndPunctuation keyboard type, but then "sometimes" when the user taps space it switches to the alphanumeric keyboard - annoying

Thanks,
Chris
kimptoc is offline   Reply With Quote
Reply

Bookmarks

Tags
first responder, keyboard, keyboardtype, uitextfield

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,471
Threads: 89,089
Posts: 380,121
Top Poster: BrianSlick (7,091)
Welcome to our newest member, cherubic
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:49 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0