协调器布局未显示在预览上

时间:2019-08-08 08:44:24

标签: android preview coordinator-layout

我有一个协调器布局,我想在其中显示带有nestedScrollView的底部工作表。但是我的协调器布局无法正常工作,因为它没有显示任何预览。

This is the preview

xml文件:

 <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:map="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context=".StartingActivity">


  <androidx.core.widget.NestedScrollView
      android:layout_width="match_parent"
      android:layout_height="250dp"
      android:background="@drawable/gradiantbackground2">

  </androidx.core.widget.NestedScrollView>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

gradle文件依赖性:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.android.support:design:29.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'devs.mulham.horizontalcalendar:horizontalcalendar:1.1.7'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'com.jjoe64:graphview:4.2.2'
    implementation 'com.google.android.material:material:1.1.0-alpha09'

}

1 个答案:

答案 0 :(得分:0)

如果未显示任何错误,请尝试重建/重新启动Android Studio。