我可以preVIEW一个开放的抽屉式导航Android Studio中

问题描述:

我在做一个应用程序,将有一个抽屉式导航栏。我的电脑不能运行AVD模拟器。即使是最小的AVD,我已经等待时间,并没有启动。话虽这么说,我不得不依靠在Android Studio设计看,应用程序将是什么样子。当创建一个抽屉式导航的活动,是有一些方法可以让我切换它是设计者打开?

I am making an app that will feature a Navigation Drawer. My computer cannot run the AVD emulator. Even with a minimal AVD, I have waited hours and it did not start up. That being said, I have had to rely on the Android Studio designer to see what the app will look like. When creating a Navigation Drawer activity, is there some way I can toggle it being open on the designer?

我发现,你可以添加工具:openDrawer =开始你的 DrawerLayout 。结果
像这样的:

I found that you can add tools:openDrawer="start" to your DrawerLayout.
Like this:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout android:id="@+id/drawer"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:openDrawer="start">

    <!-- your content include -->

    <android.support.design.widget.NavigationView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:menu="@menu/drawer"/>
</android.support.v4.widget.DrawerLayout>

演示:

算不上完美,但它就够了!