This is layout design code when i open layout preview page grey android screen showing only (android...CoordinatorLayout) and nothing showing on the screen.How can i solve this problem,i want to show the layout design in Layout Preview Screen.
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.AddDietActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:background="@drawable/menubar">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textStyle="bold"
android:textSize="18dp"/>
<TextView
android:id="@+id/submitBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="end"
android:layout_margin="10dp"
android:onClick="clickToAddDiet"
android:text="Save"
android:textSize="18sp"
android:textColor="#fff"/>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_add_diet" />
I was getting the same issue and after clicking on the info icon in the layout editor, I found out why:
Change the Theme in Editor to AppCompat
or another theme that inherits it. Worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With