简体   繁体   中英

putting recycler view above bottom navigation

i have a bottom navigation in main activity and what I'm trying to do is to show recyclerview above bottom navigation but my problem is bottom navigation is overlapping recyclerview and my recyclerview is in map fragment so that is why I'm not able to put it above bottom navigation i tried using margin but its cuts the recyclerview my xml code

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<com.google.android.gms.maps.MapView
    android:id="@+id/mapview"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</com.google.android.gms.maps.MapView>
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <android.support.v7.widget.RecyclerView
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:id="@+id/item_picker">

    </android.support.v7.widget.RecyclerView>
</RelativeLayout>
</RelativeLayout>

You are trying to set RecyclerView at the bottom of parent that's why your UI is overlapping.

Try this,

android:layout_below="@+id/mapView"
android:layout_above="@+id/yourBottomNavigationView"

So that it will not overlap with each other.

Try this android:layout_above="@+id/navigationLayout"

 <android.support.v7.widget.RecyclerView
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:layout_above="@+id/navigationLayout"
    android:id="@+id/item_picker"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM