Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] android – BottomNavigationView and AppBar covers fragment with recyclerview

Posted on November 14, 2022

Solution 1 :

Make the height of your fragment tag that hold nav host fragment 0dp

In your activity_main.xml

<fragment
    android_layout_marginTop="130dp"
    android_id="@+id/dataContainer"
    android_name="androidx.navigation.fragment.NavHostFragment"
    android_layout_width="409dp"
    android_layout_height="673dp"  ---------> ( make it 0dp )
    app_defaultNavHost="true"
    app_layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
    app_layout_constraintEnd_toEndOf="parent"
    app_layout_constraintStart_toStartOf="parent"
    app_layout_constraintTop_toBottomOf="@id/mainToolbar"
    app_navGraph="@navigation/my_nav" />

Problem :

I have an issue with placing fragment and making it scroll without being overlapped by bottomNavigationView and AppBar. So my content is covered by BottomNavigationView and AppBar.How i can make my content visible when I am scrolling page or appBar and BottomNavigationView invisible while scrolling page down?

my activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
xmlns_android="http://schemas.android.com/apk/res/android"
xmlns_app="http://schemas.android.com/apk/res-auto"
android_id="@+id/drawerLayout"
xmlns_tools="http://schemas.android.com/tools"
android_layout_width="match_parent"
android_layout_height="match_parent"
tools_context=".activities.MainActivity">

<androidx.constraintlayout.widget.ConstraintLayout
    android_layout_width="match_parent"
    android_layout_height="match_parent">

    <androidx.appcompat.widget.Toolbar
        android_theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android_id="@+id/mainToolbar"
        style="@style/mainToolbar"
        app_layout_constraintEnd_toEndOf="parent"
        app_layout_constraintHorizontal_bias="0.0"
        app_layout_constraintStart_toStartOf="parent"
        app_layout_constraintTop_toTopOf="parent"
        android_elevation="0dp"
        />

    <View
        android_layout_width="match_parent"
        android_layout_height="8dp"
        app_layout_constraintBottom_toTopOf="@id/bottomNavigationView"
        android_background="@drawable/shadow"/>


    <com.google.android.material.bottomnavigation.BottomNavigationView
        android_id="@+id/bottomNavigationView"
        android_layout_width="match_parent"
        android_layout_height="wrap_content"
        android_background="#fff"
        app_layout_constraintBottom_toBottomOf="parent"
        app_layout_constraintEnd_toEndOf="parent"
        app_layout_constraintHorizontal_bias="1.0"
        app_layout_constraintStart_toStartOf="parent"
        app_menu="@menu/bottom_menu"/>

    <fragment
        android_layout_marginTop="130dp"
        android_id="@+id/dataContainer"
        android_name="androidx.navigation.fragment.NavHostFragment"
        android_layout_width="409dp"
        android_layout_height="673dp"
        app_defaultNavHost="true"
        app_layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
        app_layout_constraintEnd_toEndOf="parent"
        app_layout_constraintStart_toStartOf="parent"
        app_layout_constraintTop_toBottomOf="@id/mainToolbar"
        app_navGraph="@navigation/my_nav" />

</androidx.constraintlayout.widget.ConstraintLayout>

<com.google.android.material.navigation.NavigationView
    android_id="@+id/navView"
    android_layout_width="wrap_content"
    android_layout_height="match_parent"
    app_headerLayout="@layout/nav_header"
    app_menu="@menu/nav_drawer_menu"
    android_layout_gravity="start"
    android_fitsSystemWindows="true" />

</androidx.drawerlayout.widget.DrawerLayout>

Is there any solutions?

READ  [ANSWERED] android - No Responsive for any screen size
Powered by Inline Related Posts

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress