Mulgard
Mulgard

Reputation: 10589

Keyboard pushes my EditText out of the screen

I have four EditText's in my Scrollview together with some checkbox and button:

The manifest for this activity:

<activity
        android:name="de.hof.ime_dc.idia_move.activities.RegisterActivity"
        android:label="@string/title_activity_register"
        android:launchMode="singleTask" >
    </activity>

When i focus firstname or lastname the EditText for firstname gets pushed out of the top screen. I cant see it but i can type in it. when i focus email or password the firstname EditText comes back into the screen. I cant understand this behavoiur because when the firstname EditText gets pushed out of screen i cant scroll up to it (They are all in a ScrollView).

Dont get me wrong, i want my views to be pushed up when keyboard appears but i dont want them to get pushed out of the screen without being able to scroll to them.

EDIT

Just an idea:

Maybe it is because of my Action Title Bar? On every screen i have a action title bar with a navigation drawer. its seems that the edittext gets pushed under the title bar. Could that be?

EDIT 2

I noticed that it just happens on android device with android version 5.0. A bug?

Upvotes: 1

Views: 760

Answers (3)

Mulgard
Mulgard

Reputation: 10589

The problem was, that i added this to my layouts:

android:layout_gravity="center"

That was the root of the evil.

Upvotes: 2

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

Just add this in your Manifest .It works for me

android:windowSoftInputMode="stateAlwaysHidden|adjustPan" 

I checked this .Please add this

 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

For more information you can see this LINK

Upvotes: 3

Ashish Tamrakar
Ashish Tamrakar

Reputation: 820

You can add "adjustResize" to your Manifest file to resolve such kind of bug -

<application ... >
    <activity
        android:windowSoftInputMode="adjustResize" ... >
        ...
    </activity>
    ...
</application>

Hope this helps you :)

Upvotes: 1

Related Questions