简体   繁体   English

Android Studio 不显示布局预览(也不会发生错误)

[英]Android Studio does not show layout preview(no error occurs also)

Android Studio does not display a preview of the layout. Android Studio 不显示布局预览。 No errors or warnings are showing.没有显示错误或警告。 I already try this solution Invalidate Caches/ Restart.我已经尝试过这个解决方案使缓存无效/重新启动。

在此处输入图片说明

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

If the system UI is on Listview will not show.如果系统 UIListview 上,则不会显示。 Look for an icon with eye and unmark show system UI寻找带有眼睛的图标并取消标记显示系统 UI

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM