I need to use a <scrollview>
layout that consists of some EditTexts
and a linear of Buttons
at the bottom, but the problem is when the soft keyboard is out, the layout doesn't scroll
and it hides the Buttons
' linear completely and the main linear (@+id/main)
goes out of the screen!
Here's a recap of my layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#03A9F4"
android:gravity="center"
>
<RelativeLayout
android:id="@+id/main"
android:layout_width="310dip"
android:layout_height="485dip"
android:background="#03A9F4"
android:gravity="center">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="435dip"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="false"
android:background="@drawable/border_signup_signin_auth">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dip"
android:orientation="vertical"
tools:ignore="UselessLeaf">
</LinearLayout>
<ScrollView
android:id="@+id/ScrollMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:isScrollContainer="false"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dip"
android:baselineAligned="false"
android:orientation="horizontal"
android:paddingLeft="10dip"
android:paddingRight="10dip">
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical"
android:paddingEnd="5dip"
tools:ignore="RtlSymmetry">
<com.rengwuxian.materialedittext.MaterialEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<com.rengwuxian.materialedittext.MaterialEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dip"
android:baselineAligned="false"
android:orientation="horizontal"
android:paddingLeft="10dip"
android:paddingRight="10dip">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical"
android:paddingEnd="5dip"
tools:ignore="RtlSymmetry">
<com.rengwuxian.materialedittext.MaterialEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<com.rengwuxian.materialedittext.MaterialEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dip"
android:baselineAligned="false"
android:orientation="horizontal"
android:paddingLeft="10dip"
android:paddingRight="10dip">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical"
android:paddingEnd="5dip"
tools:ignore="RtlSymmetry">
<com.rengwuxian.materialedittext.MaterialEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<com.rengwuxian.materialedittext.MaterialEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dip"
android:orientation="vertical"
android:paddingEnd="10dip"
tools:ignore="RtlSymmetry">
<com.rengwuxian.materialedittext.MaterialEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dip"
android:baselineAligned="false"
android:orientation="horizontal"
android:paddingLeft="5dip"
android:paddingRight="5dip">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<Button
android:id="@+id/btnSignUp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="test"
android:textSize="16sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<Button
android:id="@+id/btnGuest"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="test"
android:textSize="16sp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="false"
android:contentDescription="TODO"
app:srcCompat="@mipmap/signup"
tools:ignore="ContentDescription"/>
</RelativeLayout>
</LinearLayout>
And in the manifest I have tried the attribute:
android:windowSoftInputMode="adjustResize"
Also, I have tried same questions' solutions like:
But didn't work for me.
Does anyone know why it doesn't work?
Thanks in advance!