Let Android Radiogroup not show up on the input method _android

Source: Internet
Author: User

If you often use radiogroup during the development process, have you ever encountered the following situation

Whenever you click EditText Pop-up Input method, Radiogroup always move up to the input method above.

You might think that you need to add the following attribute to Radiogroup:

Android:layout_alignparentbottom= "true"

But when you open the XML file, it's embarrassing to find that the attribute has been added, how to solve the small bug?

In fact, simply AndroidManifest.xml add a property to the registration information for the current class in the file:

Android:windowsoftinputmode= "Adjustnothing"

The wording is as follows:

<activity
  android:name= ". Activity. Mainactivity "
  android:windowsoftinputmode=" adjustnothing "/>

Or add in the method of the activity onCreate() :

This.getwindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);

Here is the effect chart:

You may have to ask why adding this code will solve the problem, and that's about the windowSoftInputMode attribute.

First of all, from the name of this attribute, we can see how it works, this property is to set the window soft keyboard interactive mode.

Windowsoftinputmode has the following 10 values to choose from:

1.adjustNothing: window does not adjust

2.adjustPan: The contents of the current window will automatically move so that the current focus is never covered by the keyboard and the user can always see the input (the soft keyboard will block the screen)

3.adjustResize: The activity always adjusts the size of the screen to allow for soft keyboard space (you can display all screens)

4.adjustUnspecified: default settings, usually determined by the system to hide or show

5.stateAlwaysHidden: When the Activity main window gets the focus, the soft keyboard is always hidden

6.stateAlwaysVisible: When the user chooses the activity, the soft keyboard always shows the state

7.stateHidden: When the user chooses the activity, the soft keyboard is always hidden

8.stateUnchanged: When this activity appears, the soft keyboard will remain in the state of the previous activity, whether hidden or displayed

9.sstateUnspecified: The status of the soft keyboard is not specified, the system will choose a suitable state or dependent on the theme of the settings

10.stateVisible: The soft keyboard is usually visible

Summarize

The above is in the Android solution Radiogroup display in the Input Method window above the whole content of the problem, everybody learned? I hope this article for everyone to learn about Android Help, the problem of small partners can leave a message to discuss.

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.