Android makes EditText out of focus to avoid automatically pop-up input methods. androidedittext

Source: Internet
Author: User

Android makes EditText out of focus to avoid automatically pop-up input methods. androidedittext

If you enter the activity, EditText gets the focus, and the input method interface pops up, which will undoubtedly affect the appearance. For more information about how to make EditText lose focus, you can add a Textview with visibility = gone on the Internet. Then, let the textView get focus. I don't know whether my character is bad or not. I can't do this. I used another method later, that is, to add the following two codes to the parent component (layout:

android:focusable="true"   android:focusableInTouchMode="true"

For example:

<RelativeLayout android: layout_width = "match_parent" android: layout_height = "40dp" android: gravity = "center_vertical" android: background = "# ffffff" android: focusable = "true" android: focusableInTouchMode = "true"> <EditText android: layout_alignParentLeft = "true" android: id = "@ + id/searchWordET" android: layout_width = "match_parent" android: layout_height = "wrap_content" android: background = "# ffffff" android: hint = "name unit name QQ mobile phone address" android: padding = "10dp" android: imeOptions = "actionSearch" android: singleLine = "true" android: textSize = "13sp"/> </RelativeLayout>

Perfect solution!


EditText automatically obtains the focus, but does not bring up the Input Soft Keyboard ???

InputMethodManager im = (InputMethodManager) getSystemService (INPUT_METHOD_SERVICE); im. showSoftInput (TV, 0 );
 
Why does the input method not automatically pop up after EditText gets the focus?

Input Method? Web Input Method? Or system input method
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.