Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard layout hiding android action bar?

In my Android application running in a XOOM device, when I click in an Edittext the keyboard opens and hides the Actionbar. I don't want this to happen, how can I solve this? This is done by the Google Contacts app for the tablet for example.

EDIT: I have several edittexts in which the user needs fo fill. At first, when the user clicked on one edittext on the bottom, the keyboard showed up and hide the edittext in which the user was typing, so he couldn't see what he was typing. I found it really bad, and to solve it I just added to the manifest: android:windowSoftInputMode="stateVisible|adjustPan" But after that, now the screen adjust itselfs and hides the action bar.

The Google Contacts app does the same, but it magically doesn't hide the Action bar. How do they do it?

like image 578
Paulo Barros Avatar asked Nov 22 '11 14:11

Paulo Barros


People also ask

How do I hide action bars?

If you want to hide Action Bar throughout the app (Activities, Fragments) everywhere, you can simply navigate to res > values > styles.

Where is action bar in Android?

Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button.

How do I hide the activity on my keyboard?

You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field. This will force the keyboard to be hidden in all situations.


1 Answers

Use adjustResize instead of adjustPan. The framework will always try to keep the focused element on-screen by scrolling any parent views if necessary.

If your EditText field is not nested in some sort of scrolling container such as a ScrollView then your layout may be too tall to completely display when the keyboard resizes your activity. Try wrapping your form's layout in a ScrollView. This will also allow your app's content to scroll if it is running on a smaller screen device where it may have similar issues.

like image 189
adamp Avatar answered Sep 21 '22 05:09

adamp