Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 16, 2009, 12:48 PM   #1
XcodeNewb
macrumors member
 
Join Date: Feb 2009
Hide keyboard when uitextfield is pressed

I am able to hide the keyboard when the user clicks off of a uitextfield by using the [sender resignFirstResponder] command, but I want to hide it as soon as the user clicks inside the textfield. Is this possible?

I have the uitextfield "Editing Did begin" etc etc set up to call a method and that is using the same commands ( [sender resignFirstResponder] ) but the keyboard never disappears? I can see the method is being called and the commands are being run but the keyboard just stays there.

I want to call another method to change views when the user selects the uitextfield. The view changes but the keyboard is up and will not go away.

Any suggestions?

Thanks
XcodeNewb is offline   0 Reply With Quote
Old Feb 16, 2009, 12:59 PM   #2
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by XcodeNewb View Post
Any suggestions?
Don't use a UITextfield for input that isn't going to let the user type in some text? Use a different mechanism, perhaps a button instead?
dejo is offline   0 Reply With Quote
Old Feb 16, 2009, 01:02 PM   #3
XcodeNewb
Thread Starter
macrumors member
 
Join Date: Feb 2009
I am using the textfield to have the interface be consistent. There are other textfields they can edit but I wanted the look and feel to be the same. I thought about using a label but it may look a little odd.

It just seems weird that I cannot force the keyboard to not show up when a user selects the textfield. There should be a "no keyboard" option for textfields.
XcodeNewb is offline   0 Reply With Quote
Old Feb 16, 2009, 07:18 PM   #4
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by XcodeNewb View Post
It just seems weird that I cannot force the keyboard to not show up when a user selects the textfield. There should be a "no keyboard" option for textfields.
Would kinda defeat the purpose of textfields then, wouldn't it?

Have you tried disabling the textfield? You then might also need to place a transparent view over the textfield to trap the tap so that you can call your custom event.
dejo is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Can't hide keyboard in messages erpetao iOS 7 14 Oct 23, 2013 11:45 AM
No sound when button pressed sheepsblood iPhone and iPod touch Apps 0 Aug 26, 2012 02:50 PM
Need help with a UITextField method *help* iJustinCabral iPhone/iPad Programming 11 Aug 21, 2012 08:19 PM
UITextField Disappearing luke3 iPhone/iPad Programming 0 Jul 5, 2012 03:50 PM
iPad: Is it possible to Hide "The connected USB device is not supported" usb keyboard lroy12 Jailbreaks and iOS Hacks 2 Jun 5, 2012 05:15 PM

Forum Jump

All times are GMT -5. The time now is 12:31 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC