Debbie
Debbie

Reputation: 969

Android: Design view of XML file is white and blank

I created a menu folder under res folder and, in that menu folder, I created a file called drawer_menu.xml. This is the text of that file:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:showIn="navigation_view">

    <group
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:checkableBehavior="single">
        <item
            android:id="@+id/nav_profile"
            android:icon="@drawable/ic_profile"
            android:title="Message" />
        <item
            android:id="@+id/nav_my_events"
            android:icon="@drawable/ic_my_events"
            android:title="Chat" />

    </group>

    <item android:title="Communicate">
        <menu>
            <item
                android:id="@+id/nav_settings"
                android:icon="@drawable/ic_settings"
                android:title="Share" />
            <item
                android:id="@+id/nav_logout"
                android:icon="@drawable/ic_logout"
                android:title="Send" />
        </menu>
    </item>

</menu>

But the design view is white and blank. No element shows up.Also I don't get to see AppThemes option which usually shows up in layout xml files.

enter image description here

Upvotes: 2

Views: 1244

Answers (3)

5ec20ab0
5ec20ab0

Reputation: 742

Try changing support libraries version to more stable as 27.1.1

if you have 28 SDK version change to 28.0.0-alpha1

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1

Upvotes: 0

Juanjo Berenguer
Juanjo Berenguer

Reputation: 789

I am using Android Studio Canary 3.2 and looks like that.

enter image description here

So maybe is a bug of your Android Studio version.

Upvotes: 1

ʍѳђઽ૯ท
ʍѳђઽ૯ท

Reputation: 16976

I believe there is a problem with the Android Studio Preview which didn't load properly and needs to be checked. If you're using the latest Android Studio, try reopening-refreshing preview by clicking on Preview (in the right side of the app).

If this didn't solve the issue, double clicking on the Preview in the right side of the app when using code editor should show the preview or errors but i think it will be fixed by doing that since I've had the same issue and after reopening it, there were a force refresh for the layout and it fixed the issue somehow.

Upvotes: 0

Related Questions