java底部导航栏未显示在活动中
我有一个活动,有一个标题,一个片段,有一个装满卡片的回收视图和一个底部导航栏
我无法毫无问题地同时显示所有3个,最近的一次是显示所有3个,但条形图占用了卡片空间
现在这是我认为应该使用的XML:
<LinearLayout xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
xmlns:app="http://schemas.安卓.com/apk/res-auto"
xmlns:tools="http://schemas.安卓.com/tools"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
安卓:orientation="vertical"
tools:context=".habits.HabitsActivity">
<ImageView
安卓:id="@+id/imageView"
安卓:layout_width="313dp"
安卓:layout_height="166dp"
安卓:layout_gravity="center_horizontal"
app:srcCompat="@drawable/goodreasons" />
<安卓.support.design.widget.CoordinatorLayout
安卓:id="@+id/coordinatorLayout"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent">
<FrameLayout
安卓:id="@+id/contentFrame"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"></FrameLayout>
</安卓.support.design.widget.CoordinatorLayout>
<FrameLayout
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
安卓:layout_gravity="bottom">
<com.aurelhubert.ahbottomnavigation.AHBottomNavigation
安卓:id="@+id/bottom_navigation"
安卓:layout_width="match_parent"
安卓:layout_height="wrap_content"
安卓:layout_gravity="bottom" />
</FrameLayout>
</LinearLayout>
但这就产生了这样的结果:
这是片段的xml,以防您认为它也相关
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
xmlns:app="http://schemas.安卓.com/apk/res-auto"
xmlns:tools="http://schemas.安卓.com/tools"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
安卓:layout_gravity="center"
安卓:orientation="vertical"
安卓:padding="5dp"
>
<安卓.support.v7.widget.RecyclerView
安卓:id="@+id/rv_list"
安卓:layout_width="wrap_content"
安卓:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
安卓:layout_gravity="center"
/>
</LinearLayout>
共 (0) 个答案