How to make the radiogroup in Android not appear on the input method

If you often use radiogroup in the development process, have you encountered the following situations

Whenever you click edit text to pop up the input method, radiogroup always moves up to the top of the input method.

You may think that you need to add the following attribute to radiogroup:

But when you open the XML file, you are embarrassed to find that this attribute has been added. How to solve this small bug?

In fact, it's very simple, just in Android manifest Add an attribute to the registration information of the current class in the XML file:

It is written as follows:

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

The following is the rendering:

You may want to ask why adding this code can solve this problem. Let's talk about the attribute of windowsoftinputmode.

First of all, we can intuitively see its role from the name of this attribute. This attribute is used to set the interaction mode of window soft keyboard.

Windowsoftinputmode has the following 10 optional values:

1. Adjustnothing: the window is not adjusted

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

3. Adjustresize: the activity always adjusts the screen size to allow space for the soft keyboard (all screens can be displayed)

4. Adjustunspecified: default setting. The system usually decides whether to hide or display

5. Statealwaysshidden: when the activity main window gets the focus, the soft keyboard is always hidden

6. Statealwaysvisible: when the user selects activity, the soft keyboard always displays the status

7. Statehidden: when the user selects activity, the soft keyboard is always hidden

8. State unchanged: 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 select an appropriate status or subject dependent settings

10. Statevisible: the soft keyboard is usually visible

summary

The above is all about solving the problem of radiogroup displayed on the input method window on Android. Have you learned it? I hope this article is helpful for everyone to learn Android. If you have problems, you can leave a message for discussion.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>