Draw advanced Android layout

0

I'm using the layout below to hold a BottomNavigationView and call my Fragments , but I wanted to put the LinearLayout where I call the Fragments in ScrollView .

The problem is there, when I do this in a Fragment I have two EditTexts and I will type the data, the BottomNavigationView rises along with the keyboard, as the image: link

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/fundo_dashboard"
    tools:context=".HomeActivity">

        <LinearLayout
            android:id="@+id/conteudo_fragmento"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

            <android.support.design.widget.BottomNavigationView
                android:id="@+id/navigation"
                android:layout_alignParentBottom="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?android:attr/windowBackground"
                android:layout_gravity="bottom"
                app:menu="@menu/navigation" />

</RelativeLayout>
    
asked by anonymous 04.08.2018 / 07:45

1 answer

1

Within the AndroidManifest.xml file, add the android:windowSoftInputMode="adjustPan" tag as an attribute in the activity that has BottomNavigationView .

Example:

<manifest>        
    ...
    <application>
        ...
        <activity
            android:name="MainActivity"
            android:windowSoftInputMode="adjustPan"/>
    </application>
</manifest>

There are other parameters besides adjustPan but I think this is what you are looking for.

    
08.08.2018 / 21:21