【发布时间】:2021-12-04 18:41:59
【问题描述】:
Android Studio 不显示布局的预览。没有显示错误或警告。我已经尝试过这个解决方案Invalidate Caches/ Restart.
XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main"
tools:context=".MainActivity">
<ListView
android:id="@+id/peripherals_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView android:id="@+id/peripheral_list_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/peripheral_list_empty"/>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
【问题讨论】:
标签: android xml android-studio android-layout