BottomNavigation查看项目滚动

时间:2019-03-09 12:19:41

标签: android bottomnavigationview

我正在尝试做一个BottomNavigationView,但它显示为滚动菜单。我正在尝试这样的事情: 图片1:
Image1

但是在我的项目中看起来像这样:Image2:
Image2

我有主要的XML:

<android.support.constraint.ConstraintLayout 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"
xmlns:design="http://schemas.android.com/apk/res-auto"
tools:context=".PostOrSearch">


<android.support.design.widget.NavigationView
    android:layout_width="420dp"
    android:layout_height="70dp"
    android:layout_gravity="start"
    android:layout_marginTop="8dp"
    app:layout_insetEdge="bottom"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="1.0"
    design:menu="@menu/manu_layout"
    />

菜单XML:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item
    android:title="Perfil"
    android:icon="@drawable/perfil"/>

<item
    android:title="Search"
    android:icon = "@drawable/search"/>
<item
    android:title="Post"
    android:icon = "@drawable/megaphone"/>

0 个答案:

没有答案