Advanced Android Design Layout

Asked

Viewed 51 times

0

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

The problem is there, when I do it in a Fragment that I have two EditTexts and I’ll enter the data, the BottomNavigationView goes up with the keyboard, as picture: https://postimg.cc/image/zd5go6qxn/

<?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>
  • What would be your question? To ask the BottomNavigationView do not 'climb' along with the keyboard?

  • That’s right O_vagner, it goes up with the keyboard, rs.

1 answer

1

Inside the archive AndroidManifest.xml add the tag android:windowSoftInputMode="adjustPan" as an attribute in Activity that has the BottomNavigationView.

Example:

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

There are other parameters besides the adjustPan but I believe this is what you’re looking for.

  • I tried that already, it does not go up Bottomnavigationview and also Scrollview loses its function.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.