EditText default does not get focus, eject soft keyboard layout warp solution

Source: Internet
Author: User

About the pop-up soft keyboard layout transformation Solution:

Write android:windowsoftinputmode= "Adjustpan" in this activity in the Androidmainfest.xml file

In the actual development, some pages used to EditText control, this time to enter the page may automatically pop-up input method

So the display is not very friendly, so you need to set up let EditText default does not automatically get the focus. The following measures are available for online data search:

Find one in EditText's parent control, set to

Android:focusable= "true"  android:focusableintouchmode= "true"

<linearlayoutandroid:layout_width= "Match_parent" android:layout_height= "74DP" android:focusable= "true" Android : Focusableintouchmode= "true" android:gravity= "center_vertical" android:orientation= "Horizontal" Android: paddingleft= "20dip" android:paddingright= "20dip" ><textviewstyle= "@style/billdetaillabel" android:text= "@ String/takecar_car_kilometre "/><edittextandroid:id=" @+id/my_bill_detail_takecar_car_kilometre_content " style= "@style/billdetailcontent" android:layout_width= "0DP" android:layout_marginleft= "10DP" Android:layout_ weight= "1" android:gravity= "left" android:inputtype= "number" android:maxlength= "9"/><textviewstyle= "@style/ Billdetaillabel "android:layout_marginleft=" 2DP "android:text=" @string/kilometre "/><buttonandroid:id=" @+id /my_bill_detail_takepic_btn "android:layout_width=" wrap_content "android:layout_height=" Wrap_content "Android: layout_marginleft= "10DP" android:background= "@drawable/my_bill_detail_camera_icon_selector"/></ Linearlayout>

The element that starts to get focus automatically is my_bill_detail_takecar_car_kilometre_content

When I set the linearlayout above the parent node of the EditText

Android:focusable= "true" android:focusableintouchmode= "true"

After that, the screen will not start. Default Input method is started

EditText default does not get focus, eject soft keyboard layout warp solution

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.