Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bottom navigation bar hides part of a view

Tags:

android

In my app I want to display a simple Image,

On my Samsung Galaxy S7 Real device the image is fine, The bottom Navigation bar is not part of the view but part of the phone itself. The whole of the Image is present.

On the Android Emulator the bottom navigation bar is part of the view and the image is partially hidden

Here is my simple Linear Layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout         
    xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          android:background="@color/md_blue_50"
          android:orientation="vertical">

    <include
        android:id="@+id/app_bar"
        layout="@layout/toolbar"/>

    <ImageView
        android:id="@+id/photo_image_large"
        android:adjustViewBounds="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="fill_vertical"
        android:scaleType="fitXY"/>

</LinearLayout>

Here is the Android Emulator Screenshot

android emulator

Here is my Samsung Galaxy Real Device Screenshot

android real device

The problem also occurs in recycler Views in the app the bottom part of the image is cut off on the android emulator...

like image 742
Andy Cass Avatar asked Mar 22 '17 13:03

Andy Cass


People also ask

Why is my navigation bar hiding?

The navigation bar is pinned by default. If you want to view files or use apps in full screen, double-tap the Show and hide button to hide the navigation bar. To show the navigation bar again, drag upwards from the bottom of the screen.

How do I adjust the navigation bar at the bottom?

To create a Menu, first, create a Menu Directory by clicking on the app -> res(right-click) -> New -> Android Resource Directory and select Menu in the Resource Type. To create a Menu Resource File , click on the app -> res -> menu(right-click) -> New -> Menu Resource File and name it bottom_nav_menu.

What is the bottom navigation bar called?

Container (navigation bar) used to display destinations. Active (pressed / highlighted) icon and text label of the destinations. In-active (pressed / highlighted) icon and text label of the destinations.

How do I use the bottom navigation view?

BottomNavigationView makes it easy for users to explore and switch between top-level views with a single tap. There should be a minimum of 3 top-level views and a maximum of 5. If Destinations are more than 5 then use the Navigation Drawer. When the user taps on the icon it will change the top-level view accordingly.


1 Answers

It's because of android:fitSystemWindows put it to false and it should be good

like image 76
Ler Avatar answered Sep 29 '22 23:09

Ler