![](/img/trans.png)
[英]In my layout there is recyclerview and bottom navigation bar but navigation bar goes behinf the recycler view
[英]putting recycler view above bottom navigation
我在主要活动中有一个底部导航,我想做的是在底部导航上方显示recyclerview
,但是我的问题是底部导航重叠了recyclerview
而我的recyclerview
在地图片段中,所以这就是为什么我不能放我在底部导航上方尝试使用边距,但它削减了recyclerview
我的xml代码
<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>
您正在尝试在父级的底部设置RecyclerView
,这就是您的UI重叠的原因。
尝试这个,
android:layout_below="@+id/mapView"
android:layout_above="@+id/yourBottomNavigationView"
这样它就不会彼此重叠。
试试这个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"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.