CardView 在预览中显示灰色屏幕?
CardView showing greyscreen in preview?
我的 Cardview 显示灰屏。我能知道这些问题的原因吗?
我试过使缓存无效并重新启动,但它不起作用
这是我的卡片视图
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="200dp"
card_view:cardCornerRadius="4dp">
<TextView
android:id="@+id/info_text"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v7.widget.CardView>
</LinearLayout>
这是我的预览
这是一个粗心的错误,实际上我忘记在我的 gradle(app) 中添加实现 'com.android.support:cardview-v7:28.0.0'。
我的 Cardview 显示灰屏。我能知道这些问题的原因吗?
我试过使缓存无效并重新启动,但它不起作用
这是我的卡片视图
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="200dp"
card_view:cardCornerRadius="4dp">
<TextView
android:id="@+id/info_text"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v7.widget.CardView>
</LinearLayout>
这是我的预览
这是一个粗心的错误,实际上我忘记在我的 gradle(app) 中添加实现 'com.android.support:cardview-v7:28.0.0'。