Can I view the open navigation box in Android Studio

I am creating an application that will contain a navigation box. My computer cannot start the AVD emulator. Even with minimal AVD, I waited hours and it did not start. In doing so, I had to rely on the Android Studio designer to see how the application would look. When creating activity of the navigation box, is there any way to switch it to the designer?

+5
source share
1 answer

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> 

Demo:

not quite perfect, but enough!

+16
source

Source: https://habr.com/ru/post/1216532/


All Articles