Android Studio 不顯示布局預覽。沒有顯示錯誤或警告。我已經嘗試過這個解決方案使快取無效/重新啟動。

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>
uj5u.com熱心網友回復:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".MainActivity">
<TextView
android:id="@ id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ListView
android:id="@ id/list"
android:layout_width="wrap_content"
android:layout_below="@ id/txt"
android:layout_height="wrap_content"/>
</RelativeLayout>
uj5u.com熱心網友回復:
如果系統 UI在Listview 上,則不會顯示。尋找帶有眼睛的圖示并取消標記顯示系統 UI
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/321712.html
