Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone ($4.99)

dotnetIQ ($4.99)

Your First iPhone App ($1.99)

iPocket Tools 9 in 1 ($0.99)

Catch-Me (Free)

Alien Strike ($0.99)

Historic Olympic Medal-Table ($1.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: 23
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: 21,508
Threads: 35,792
Posts: 156,797
Top Poster: smasher (2,449)
Welcome to our newest member, JoelSelwood7
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:40 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0