uitextfield hide keyboard on return

Ads
 

uitextfield hide keyboard on return

I am working on a iPhone project. I want to hide the keyboard when use clicks on the return button of the IOS keyboard in iPhone/iPad. How to hide the keyboard on return key. What is the best way to hide the keyboard which was displayed automatically when user clicked on the UITextField?

Thanks

View Answers

December 31, 2014 at 9:38 AM

Hi,

Here is the steps to achieve this:

  1. Make the view controller as delegate of UITextField and then
  2. add the following code:

    -(BOOL) textFieldShouldReturn:(UITextField *)textField{

    [textField resignFirstResponder];
    return YES;
    

    }

The application will start hiding the keyboard when use clicks on the return button of the iPhone keyboard.

Thanks

Ads









Related Tutorials/Questions & Answers:
uitextfield hide keyboard on return
uitextfield hide keyboard on return  I am working on a iPhone project. I want to hide the keyboard when use clicks on the return button of the IOS keyboard in iPhone/iPad. How to hide the keyboard on return key. What is the best
hide keyboard iphone
hide keyboard iphone  Can anyone tell me how to hide keyboard in my simple view based application in iphone?   Hiding keyboard in iPhone... resignFirstResponder]; return YES; } Where textField is the object of your UITextField
Advertisements
uitextfield disable keyboard
uitextfield disable keyboard  How to disable keyboard of UITextView in iPhone SDK application?   There are two ways to disable the keyboard of UITextField in iPhone SDK application - (BOOL)textFieldShouldBeginEditing
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
resign first responder keyboard
resign first responder keyboard  Hi, How I can hide keyboard on click on of done button in keyboard. Give me example of resign first responder keyboard example code. Thanks   Hi, Make your controller delegate to text
UITextField Programmatically iPhone
UITextField Programmatically iPhone  How to create UITextField Programmatically in iPhone
uitextfield append text
uitextfield append text  How can i append text or string to UITextField in my iPhone application? Thanks!   Appending a string / text to a UITextField -(Void)buttonPressed { NSString *myS = [NSString stringWithFormat
UITextField Background Image
UITextField Background Image  How can i set a background image on UITextField. I have placed that UITextField on UIToolBar.   Code to Set a Background Image on UITextField - (void)viewDidLoad { [super viewDidLoad
UITextfield Background Color
UITextfield Background Color  In my iPhone application, i am using text field as a search field. The code is working fine but the problem...; iPhone UITextField Background Color Set the text field background color
uikeyboard done button/return button
uikeyboard done button/return button  Hi everyone!!! Just worried about ..how to return the UIKeyboard on done or return button click in my iPhone... to return the uikeyboard on done button click. Do not forget to call <
How to set placeholder in uitextfield programmatically?
How to set placeholder in uitextfield programmatically?  Can any one tell me about the example code for setting the placeholder in a UITextField programatically? Thanks   HI, Its easy. Use the following code
keyboard input
keyboard input  how do I use JOptionPane to accept keyboard input? I know how to import but not specific command on input line   import javax.swing.*; class JOPtionPaneExample { public static void main(String
hide url
hide url  how i can hide url i have lot of jsp pages when i call one jsp in address another jsp page name also displayed in the address bar? url not visible to endusers please tell me any answer what i should do
JavaScript Hide Button
hide(){ document.button.butt.style.visibility = 'hidden'; return... JavaScript Hide Button...; In this section, you will learn how to hide the button using JavaScript
Hide the Jsp Page
Hide the Jsp Page  I want to hide the Entire JSP Page.is it possible
javascript hide element
javascript hide element  How can we hide / show HTML elements using JavaScript
ModuleNotFoundError: No module named 'keyboard'
ModuleNotFoundError: No module named 'keyboard'  Hi, My Python... 'keyboard' How to remove the ModuleNotFoundError: No module named 'keyboard... to install padas library. You can install keyboard python with following
ModuleNotFoundError: No module named 'hide'
ModuleNotFoundError: No module named 'hide'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'hide' How to remove the ModuleNotFoundError: No module named 'hide' error
How to Create Keyboard in JAVA
How to Create Keyboard in JAVA  please help me to create On-Screen Keyboard with java and please give me an another idia to make it ..............iam waiting for your help ,think u so much
UINavigationController hide navigation bar
UINavigationController hide navigation bar  HI, How to hide the navigation bar of UINavigationController? I have to hide navigation bar of UINavigationController on the click of a button. Thanks   Hi, Use following
Hide tabbar in iphone
Hide tabbar in iphone  Hi, How to Hide tabbar in iphone? Thanks   Hi, Code for hiding tabbar: self.tabBarController.tabBar.hidden = YES; Code for displaying tabbar: self.tabBarController.tabBar.hidden
disable keyboard in java applet
disable keyboard in java applet  How to disable key board of my client in an java applet embedded in a website while the applet is running.? Plz help
ios hide status bar
ios hide status bar  HI, I am developing an application in IOS. Can anyone tell me how to? hide status bar? Thanks   Hi, Following code can be used: [[UIApplication sharedApplication] setStatusBarHidden:YES
how to hide and unhide folders in java
how to hide and unhide folders in java   i want to hide folder along with its contents and unhide later
hide the url in address bar
hide the url in address bar  how i can hide url in address bar????? i have lot of jsp pages when i call one jsp in address another jsp page name also... with hide the username and password i will send the project urgently please tell
Dynamically hide textbox
Dynamically hide textbox  I have a drop down(combo box) with 2 values (reference and file).When refrence is selected from the drop down the components of file(that is displayed when file is selected) should get hidden dynamically
ModuleNotFoundError: No module named 'DancePad-Keyboard'
ModuleNotFoundError: No module named 'DancePad-Keyboard'  Hi, My... named 'DancePad-Keyboard' How to remove the ModuleNotFoundError: No module named 'DancePad-Keyboard' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'em-keyboard'
ModuleNotFoundError: No module named 'em-keyboard'  Hi, My Python... 'em-keyboard' How to remove the ModuleNotFoundError: No module named 'em-keyboard' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'eye-keyboard'
ModuleNotFoundError: No module named 'eye-keyboard'  Hi, My Python... 'eye-keyboard' How to remove the ModuleNotFoundError: No module named 'eye-keyboard' error? Thanks   Hi, In your python

Ads