Home » Java » Android Studio 3.0 Layout Editor/Previewer

Android Studio 3.0 Layout Editor/Previewer

Posted by: admin June 30, 2018 Leave a comment

Questions:

I am using Android Studio 3.0 to make an Android App.

But the issue I am facing is that the Layout editor/previewer is not working properly. It is sometimes not showing anything and at times it is showing a grey box with all the navigation buttons.

These are the screenshots

Screenshot 1

Screenshot 2

I am using the buildToolsVersion '26.0.2' and the support libraries version is 23.0.1

Any help would be really helpful.

EDIT: This is my XML Layout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#000000"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="100dp"/>

        <ImageView
            android:id="@+id/logo"
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_gravity="center"
            android:background="@drawable/logo" />

        <TextView
            android:id="@+id/name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#FFFFFF"
            android:textSize="33dp"
            android:textStyle="bold" />


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:layout_marginBottom="15dp">
            <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="15dp"
            android:textColor="#FFFFFF" />

     </LinearLayout>

     </LinearLayout>

</RelativeLayout>
Answers: