我正试图将导航抽屉放在操作栏上,当它向右滑动时就像这个应用程序:[已删除]
这是我的主要活动的布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout ...>
<RelativeLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
...
</RelativeLayout>
<fragment android:name="com...."
android:layout_gravity="start"
android:id="@id/navigation"
android:layout_width="@dimen/navigation_menu_width"
android:layout_height="fill_parent" />
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
stackoverflow上的其他一些问题与此问题类似, 但所有答案都建议使用滑动菜单库.但是这个应用程序他们仍然使用android.support.v4.widget.DrawerLayout并且他们成功了.不要问我怎么知道他们使用标准导航抽屉,但我确定.
非常感谢您的帮助.
这是最终的解决方案:非常感谢@Peter Cai这项工作完美无缺. https://github.com/lemycanh/DrawerOnTopActionBar