【问题标题】:How Can I Resolve Preview Display Issues in Android Studio After Upgrading to Electric Eel?升级到电鳗后如何解决Android Studio预览显示问题?
【发布时间】:2023-01-31 14:48:33
【问题描述】:
<?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>

预览将如下所示:

<?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>

预览将如下所示:

我将 Android Studio 升级到 Electric Eel,现在,在 XML 中,预览经常无法像第一张图片那样正确显示。为什么会发生这种情况,我该如何解决?此问题仅在我升级 Android Studio 后出现。

【问题讨论】:

    标签: android android-studio intellij-idea material-design


    【解决方案1】:

    我也有这个问题,我将材料版本更改为 1.7.0 并且 Android Studio 布局渲染再次工作

    【讨论】:

      【解决方案2】:

      我将 Material Design 库从 1.8.0 降级到 1.7.0,问题就消失了。我认为问题出在新版本的 Material Design 上。

      【讨论】:

      • 不,问题绝对不是 Material Design 库的新版本,因为我已经在使用 1.7.0 版本(我没有升级到 1.8.0),而且我仍然遇到了 OP 的问题。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-25
      • 1970-01-01
      • 1970-01-01
      • 2019-07-28
      • 1970-01-01
      • 2023-01-16
      • 1970-01-01
      相关资源
      最近更新 更多