本文介绍了抽屉式导航栏包括我的工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的材料设计导航抽屉的这个例子中,问题是,当我打开我的抽屉里,它涵盖了我的行动吧too..and我的抽屉里图标是不是visible..this是什么,我得到..而以下是我的code ..
I am using this example of material design navigation drawer,the issue is,when i open my drawer,it covers my action bar too..and my drawer icon is not visible..this is the what i am getting..and following is my code..
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/container_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
</LinearLayout>
<FrameLayout
android:id="@+id/container_body"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<fragment
android:id="@+id/fragment_navigation_drawer"
android:name="info.androidhive.materialdesign.activity.FragmentDrawer"
android:layout_width="@dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="@layout/fragment_navigation_drawer"
tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
推荐答案
我会建议使用具有垂直方向为父母的线性布局,然后第一个孩子是你的工具栏和第二个你的抽屉布局。
I would suggest to use a linear layout with vertical orientation as parent and then the first child is your toolbar and the second your drawer layout.
linearlayout vertical
toolbar
drawerlayout
希望这有助于。
这篇关于抽屉式导航栏包括我的工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!