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 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









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
Iphone keypad app
to show you how to hide keyboard or number pad and return to the actual screen. We... hide the keyboard on click anywhere on the screen.   Generally whenever...(keyboard) automatically but there will be no method to hide it. So you have to have
UITextfield checking
UITextfield checking  hello,, how can i check UITextfield length or any specific value..   hii,ADS_TO_REPLACE_1 here is some code for textfield checking if ([name.text isEqualToString:@"hello
UItextfield blank
UItextfield blank  Hi, How I can check if UITextfield is blank and then display error to the user? ThanksADS_TO_REPLACE_1   Hi, Following code can be used to validate the user input in iPhone and iPad applications
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 <
Keyboard Done button in iphone
Keyboard Done button in iphone  hii,, how can i set a function on press keyboard done button.   hello,ADS_TO_REPLACE_1 For making keyboard Done button press :- import keyboard displacement by adding this line
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
JavaScript Hide Button...; In this section, you will learn how to hide the button using JavaScript... the page you will get the button. On clicking the button, the function hide
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
javascript hide element
javascript hide element  How can we hide / show HTML elements using JavaScript
Hide the Jsp Page
Hide the Jsp Page  I want to hide the Entire JSP Page.is it possible
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
PHP hide file path
PHP hide file path  PHP to read a path and convert that to the virtual link
Hide hyperlink using jQuery
;).hide(); $("a").click(function () { $(this).hide(); return...Hide hyperlink using jQuery In this tutorial, we will discuss about how to hide hyperlink after clicking it using jQuery. In the below example , a hyperlink
Return keyword
Return keyword  how do we use return in methods?   Java use of return keyword import java.util.*; public class ReverseString{ public...).reverse().toString(); return rev; } public static void main(String
hide division - JSP-Servlet
hide division  On click Hide one dividion and visible another division...   Hi Friend, Try the following code: function showhide() { document.getElementById('div2').style.visibility = 'visible
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
keyboard shortcuts - Swing AWT
keyboard shortcuts  Hello, i m facing problem in invoking a button it is an arrow button. although the user can click on it with a mouse... when we press the upper arrow from the keyboard that button should be invoked
java keyboard shortcuts - Struts
java keyboard shortcuts  hi, i hav an application already developed using struts framework.now i would like to add some keboard shortcuts to my application, so that the user need not to go for the usage of the mouse every time
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
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
What it will return ..... ?
What it will return ..... ?   import java.util.*; public class Name { private final String first, last; public Name(String first, String last...) { if (!(o instanceof Name)) return false; Name n = (Name)o; return n.first.equals
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 'Py-Keyboard'
ModuleNotFoundError: No module named 'Py-Keyboard'  Hi, My Python... 'Py-Keyboard' How to remove the ModuleNotFoundError: No module named 'Py-Keyboard' error? Thanks   Hi, In your python environment
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 '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
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
ModuleNotFoundError: No module named 'remarkable-keyboard'
ModuleNotFoundError: No module named 'remarkable-keyboard'  Hi, My... named 'remarkable-keyboard' How to remove the ModuleNotFoundError: No module named 'remarkable-keyboard' error? Thanks   Hi
ModuleNotFoundError: No module named 'amharic-keyboard'
ModuleNotFoundError: No module named 'amharic-keyboard'  Hi, My... named 'amharic-keyboard' How to remove the ModuleNotFoundError: No module named 'amharic-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 'keyboard-listener'
ModuleNotFoundError: No module named 'keyboard-listener'  Hi, My... named 'keyboard-listener' How to remove the ModuleNotFoundError: No module named 'keyboard-listener' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'keyboard-simulator'
ModuleNotFoundError: No module named 'keyboard-simulator'  Hi, My... named 'keyboard-simulator' How to remove the ModuleNotFoundError: No module named 'keyboard-simulator' error? Thanks   Hi, In your
How to connect on screen keyboard to system.
How to connect on screen keyboard to system.  How to connect on screen keyboard to system.I made on screen keyboard in java(swing).Now i want connect to system means when i pressed any button then it type on notepad or any
How to connect on screen keyboard to system.
How to connect on screen keyboard to system.  How to connect on screen keyboard to system.I made on screen keyboard in java(swing).Now i want connect to system means when i pressed any button then it type on notepad or any

Ads