The solution to the top of the layout when the Android soft keyboard pops up

Source: Internet
Author: User

method, in Mainfest.xml, for that activity plus:

<activityandroid:name= ". Activity. Homeactivity"android:windowsoftinputmode=" Adjustpan|statehidden"></activity>


Will not put the original activity layout to top up.

%¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥

Today to do a search function, the search interface using Autocompletetextview to do the search bar, and then the following with the ListView to display the search results, and my main interface is at the bottom of the tab to do a main interface navigation, which has a search button, Because in the search bar to enter the text will pop up the software disk, but if you do not make any settings, the soft keyboard pop out at the same time, will be the following tab navigation to the corresponding screen, the interface shows the distortion Ah, and then found a solution, in the corresponding activity (such as I This is the tab activity, using Adjustpan) to add

Android:windowsoftinputmode This property, the following details this property:

& X! Q6c9}% I.] 6 @0 Y "n6^ d {" X

The Windowsoftinputmode property sets the value description.

<activityandroid:windowsoftinputmode=["Stateunspecified",

" stateunchanged", "Statehidden",

" Statealwayshidden", "statevisible",

" statealwaysvisible", "adjustunspecified",

"Adjustresize", "... >

</activity>

attributes:

Android:windowsoftinputmode

How the active main window interacts with the Soft keyboard window on the containing screen. The setting of this property will affect two things 7s7 u+ s! p7 S (U) N:t: m& n
:

1>
the state of the soft keyboard--whether it is hidden or displayed--when the active 5w$ r-u9 i "H. O ' m" M
(Activity) become the focus of attention of users.

2>&NBSP;&NBSP;
main window adjustment-whether to reduce the active main window size to make room for a soft keyboard or whether the current focus of its content is visible when part of the active window is overwritten by a soft keyboard.

its settings must be in the list below A value, or a
value plus one + S. Z "M5 u: {; k; B7v4 Q
"Adjust ..."

mdash There are undefined results. Use +h8 v$ q#-F3 b& ' -G8 C $ y
| separate. For example
:<activityandroid:windowsoftinputmode= "statevisible| Adjustresize "...;

The value in this setting is 8a:n! L ' x0 ': C
( except ' H0 N "G, W2 W) K F # y2 L!c
"Stateunspecified" and
"Adjustunspecified" outside 3 ^, p2e g:i2 y/v
overrides the value set in the theme.


overrides the value set in the theme

value

Description

"Stateunspecified"

the state of the soft keyboard
( whether it is hidden or visible
) is not specified. The system will select an appropriate state or a theme-dependent setting. This is the default setting for the software disk behavior.

"Stateunchanged"

The soft keyboard is persisted regardless of its last state, whether visible or hidden, when the main window appears in front.

"Statehidden"

when the user selects the
during Activity, the soft keyboard is hidden-that is, when the user determines to navigate to the # ^* {1 W. c:y-}
Activity when instead of returning to it due to leaving another :}/N! P (A * M% W. b%m9 b# u
Activity.

"Statealwayshidden"

The soft keyboard is always hidden when the
When the Activity main window gets focus.

"Statevisible"

The soft keyboard is visible, when that is normal and appropriate & d% G.y8 [; G _: V
( when the user navigates to "s2 i/j$ S2 W7 J) j6o& J, F
When the Activity main window
).

"Statealwaysvisible"

when the user chooses this 6 z%c e/r0 u,m ' 7N r
during Activity, the soft keyboard is visible-that is, when the user determines to navigate to the . m; R6 r% T. ' # A4 c0^, T; d! V
Activity when instead of returning to it due to leaving another
Activity.

"Adjustunspecified"

It is not specified whether the "H9 b! V3 h5_& o$ d$ M B "V5j:d
The Activity main window resizes to allow space on the soft keyboard, or whether the contents of the window are visible on the screen with the current focus. The system will automatically select one of these modes primarily depending on whether the contents of the window have any layout view that can scroll their content. If there is such a view, the window will be resized so that the contents of the scrolling window can be visible in a smaller area. This is the default behavior setting for the main window.

"Adjustresize"

the /M "r:m-W (Z. Q6 d*a
The Activity main window is always resized on the screen to allow space for the soft keyboard

"Adjustpan"

the
The Activity main window does not adjust the size of the screen to allow space for the soft keyboard. Instead, the contents of the current window are automatically moved so that the current focus is never covered by the keyboard and the user can always see the part of the input. This is usually not expected than resizing, because the user may turn off the soft keyboard in order to get an interactive operation with the covered content.


The solution to the top of the layout when the Android soft keyboard pops up

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.