0

I've got a layout that looks like first image and when I open the softkeyboard looks like the second image, but I want it how it seems on third image:

My Layout How it looks with keyboard opened Result wanted

I read a lot about adjustpan and adjustresize on the manifest but nothing works, the xml structure is:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blanco"
android:gravity="top"
android:orientation="vertical"
android:weightSum="10" >

<!-- LOGO -->

<LinearLayout
    android:id="@+id/logo"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="3.7"
    android:background="@color/green_logo"
    android:orientation="vertical"
    android:gravity="center"
    android:paddingTop="65dp" >

    <ImageView
        android:id="@+id/logo_registro"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:src="@drawable/logo_registro" />
</LinearLayout>

<FrameLayout
    android:id="@+id/contentFragment"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="6.3" >

</FrameLayout>
</LinearLayout>

First part is the green part with the app logo and inside the FrameLayout I put Fragments that contains simple LinearLayouts or RelativeLayouts with parts of my Login forms.

deimian86
  • 1,127
  • 1
  • 11
  • 26

3 Answers3

0

Put this on your Manifest, inside the activity

<activity android:name=".YourActivity"
              android:configChanges="keyboard|keyboardHidden"></activity>
Alejandro Cumpa
  • 2,118
  • 1
  • 24
  • 45
  • Don't work, sorry :( I don't wanna hide the keyboard by default, I want the screen scrolls to my wanted position when the keyboard opens, and not adjust automatically to the EditText – deimian86 Apr 13 '15 at 14:47
0

Set your windowSoftInputMode in your manifest for this activity to be adjustResize. THere are 3 possible settings for this- nothing, resize (shrinks your app to fit the remaining space), and pan (scrolls your app so the focused field remains on screen).

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
0

Just Add the empty scrollview and it will work

 <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
</ScrollView>
Muhammad Younas
  • 1,543
  • 1
  • 22
  • 32