我可以preVIEW一个开放的抽屉式导航Android Studio中 [英] Can I preview an open Navigation Drawer in Android Studio
本文介绍了我可以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>
演示:
<子>算不上完美,但它就够了!
这篇关于我可以preVIEW一个开放的抽屉式导航Android Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文