简体   繁体   English

导航抽屉和底部栏

[英]Navigation Drawer and Bottom Bar

I have implemented a navigation drawer and a bottom navigation bar. 我已经实现了一个导航抽屉和一个底部导航栏。

My problem is that the navigation drawer is as heigh as the contents frame height. 我的问题是导航抽屉的高度与内容框的高度一样。 So when the navigation drawer is opened, the bottom navigation bar will get partially hidden just like the contents of the main layout. 因此,当打开导航抽屉时,底部导航栏将被部分隐藏,就像主布局的内容一样。

I have tried the following to overcome this issue: 我尝试了以下方法来克服此问题:

  • Get the height of the bottom navigation bar. 获取底部导航栏的高度。
  • Set the height of the navigation drawer to (drawer's height - bar's height) 将导航抽屉的高度设置为(抽屉的高度-条形的高度)

But this way the drawer does not know about the changes of the height. 但是这样抽屉不知道高度的变化。

Here is what I want to accomplish: 这是我要完成的工作:

在此处输入图片说明

Have our layout something like that: 让我们的布局是这样的:

<RelativeLayout>

    <android.support.v4.widget.DrawerLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <!-- The main content view -->

     <!-- The navigation drawer -->

   </android.support.v4.widget.DrawerLayout>

   <!-- Your bottom bar --!>
</RelativeLayout>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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