【发布时间】: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