uitextfield hide keyboard on return

 
 

Share on Google+Share on Google+

Java Coder
uitextfield hide keyboard on return
1 Answer(s)      2 years and 11 months ago
Posted in : MobileApplications

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

Ads
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
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, here is some code for textfield checking if ([name.text isEqualToString:@"hello"]) or if (name.text.length<1
UItextfield blank
UItextfield blank  Hi, How I can check if UITextfield is blank and then display error to the user? Thanks   Hi, Following code can be used to validate the user input in iPhone and iPad applications. if([loginID.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 <
Keyboard Done button in iphone
Keyboard Done button in iphone  hii,, how can i set a function on press keyboard done button.   hello, For making keyboard Done button press :- import keyboard displacement by adding this line #define kOFFSET
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
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
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
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
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
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
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
PHP hide file path
PHP hide file path  PHP to read a path and convert that to the virtual link
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
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 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

Ads

 
Advertisement null

Ads