5, the Input method pop-up layout confusion solution

Source: Internet
Author: User

Now there is such a layout:

1<?xml version= "1.0" encoding= "Utf-8"?>2 3<Com.clientMenu.CustomScrollView4Xmlns:android= "Http://schemas.android.com/apk/res/android"5Android:layout_width= "Match_parent"6android:layout_height= "Match_parent"7Android:id= "@+id/scrollview_new_from_history_menu"8>9     Ten<!--android:fillviewport= "true"-- One      A<Relativelayout -Android:layout_width= "Match_parent" -android:layout_height= "Match_parent" theAndroid:id= "@+id/relativelayout_new_from_history_menu" -android:background= "@drawable/blackboard" > -/> -              +</RelativeLayout> -      +  A      at</com.clientMenu.CustomScrollView>

1. Add a relative layout to a custom ScrollView

2, when the program run up, and dynamically create a few edittext

3, and these input boxes are supported by drag and drop

Now that the problem has come, when I drag the input box control to a position, if you go to edit another input box, then when the Input method pops up, the entire layout will revert to the way it was before moving, see the figure below:

1, the initial

2. Now move "tomato brisket rice" to another location

3, when the "Tomato beef brisket Rice" price "24 yuan", "Tomato beef brisket rice" back to the previous position

So why is there such a problem? I think for a long time, the problem is located in the following several points:

1, the response process of input method in ScrollView

2, the Input method pops the specific process to the layout influence

3. How the controls in the activity are displayed on the screen

So why join a custom ScrollView? The first is to pop the input method, the bottom of the control is not obscured by the input method, the second is to be able to freely control the ScrollView can scroll.

How does the Input method pop up a process? Neither the StackOverflow nor the Google Developer documentation specifically describes the process.

Next, I put emphasis on the process of drawing the layout. This is explained in section 13.2 of the website:

Draw layout and two traversal processes: measurement process and layout process

The measurement process is done by the measure (Int,int) method, which traverses the view tree from top to bottom. In recursive traversal, each view passes dimensions and specifications down the layer. When the measure method traversal is complete, each view holds its own size information

The layout process is done by the layout (Int,int,int,int) method, which is also the top-down traversal of views, in which each parent view locates the location information of all the child views through the results of the measurement process.

5, the Input method pop-up layout confusion 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.