solution:
set the windowSoftInputMode property in the corresponding to the interface in the AndroidManifest.xml file
<activity
android:name=".PhoneContactActivity"
android:label="@string/title_activity_phone_contact"
android:windowSoftInputMode="adjustPan|stateHidden" >
</activity>
android:windowSoftInputMode description:
the interaction mode between activity main window and soft keyboard can be used to avoid the problem of input method panel occlusion, a new feature after Android1.5.
this is a performance that affects two things:
1. When focus is generated, whether the soft keyboard is hidden or displayed
2. Whether to reduce the size of the active main window to make room for a soft keyboard
The setting of
windowSoftInputMode must be one of the values in the following list, or a "state." Value plus a "adjust." A combination of values. Set multiple values in any group-multiple "state." Values, for example & mdash has undefined results. Use "separate" between values.
for example:
the value set here (except for "stateUnspecified" and "adjustUnspecified") will override the value set in the theme
meaning of each value:
- the state of the stateUnspecified: soft keyboard is not specified, and the system will choose an appropriate state or theme-dependent settings
stateUnchanged:. When this activity appears, the soft keyboard will remain in the state of the previous activity, whether hidden or shown
when stateHidden: users choose activity, the soft keyboard is always hidden
stateAlwaysHidden: when the Activity main window gets focus, the soft keyboard is always hidden
stateVisible: soft keyboard is usually visible
when a stateAlwaysVisible: user selects activity, the soft keyboard always shows the status
adjustUnspecified: is set by default, and it is usually up to the system to decide whether to hide or show
.
adjustResize: the Activity always resizes the screen to make room for the soft keyboard
adjustPan: the contents of the current window will automatically move so that the current focus is never overridden by the keyboard and the user can always see the part of the input
for example:
AndroidManifest.xml<activity>
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="stateVisible|adjustResize"
android:windowSoftInputMode="adjustPan|stateHidden"
if you are interested in android technology, you can follow Wechat's official account: terminal R & D Department, and communicate and study with me.
Terminal R & D Department is a technology-based learning and exchange technology number, talking about technology, products, but also our lives. Be the most thoughtful and interesting Internet developer in the Eastern Hemisphere