skip to Main Content
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".fragments.MainFragment">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </com.google.android.material.card.MaterialCardView>

</androidx.constraintlayout.widget.ConstraintLayout>

Preview will looks like this:

enter image description here

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".fragments.MainFragment">

</androidx.constraintlayout.widget.ConstraintLayout>

Preview will looks like this:

enter image description here

I upgraded Android Studio to Electric Eel and now, in XML, the preview often fails to display properly as in the first image. Why does this happen and how can I resolve it? This issue only occurred after I upgraded Android Studio.

2

Answers


  1. Chosen as BEST ANSWER

    I downgraded the Material Design library from 1.8.0 to 1.7.0 and the problem disappeared. I think the issue was with the new version of the Material Design.


  2. I have this issue too, I change material version to 1.7.0 and Android Studio Layout Rendering working again

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search