Navbar overlapping last ListView item (Android)

ぃ、小莉子 提交于 2019-12-03 02:43:40

Ok the problem is the following, the cardview match parent height is actually the full screen height with top bar. An very easy fix for this is to add:

    android:layout_marginBottom="?attr/actionBarSize"

like this:

<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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginBottom="?attr/actionBarSize"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.example.jburg.empty.Main22Activity"
    tools:showIn="@layout/activity_main22"
    android:background="@color/colorAccent"/>

This works on my emulator nexus 10 tablet. Let me know if this helps you otherwise I'll keep searching :)

Omid Heshmatinia

did you try this

Bottom soft NavigationBar overlaps my ListView

The Only problem is that you mention you don't want to change your style file ( didn't mention why! ) and that user achieve your result by changing style file.

Bob

Try adding this line android:fitsSystemWindows="true" to the CoordinatorLayout.

try to add this code in imageview.

android:layout_below="@+id/clubhouse_toolbar_main"

Just a suggestion :
You could add a dummy button with visibility="invisible"(not "gone"). The default height of a button is almost same as that of the Navigation Bar. So even if the Navigation bar is over the button, your important data will be fully visible(Above the navigation bar). And you don't have to think about the button being seen.

In your case i'm assuming that you have some scrollable view in your Fragment. So you should put the button inside your fragment xml under your scrolllable view(listview, recyclerview ...) or at the bottom of your fragment xml.

just add bottom padding same as height of bottom navigation bar in RecyclerView.

It looks like something related to SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION. Make sure that your activity does not have this flag set in setSystemUiVisibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!