[英]inflate exception widget recycleview
在下面的行上引發錯誤
setContentView(R.layout.activity_main);
android.view.InflateException:二進制XML文件第9行:錯誤膨脹了類android.support.v7.app.widget.RecycleView
我想念什么?
碼
MainActivity.java
package com.example.xxx.yyyy;
import android.database.sqlite.SQLiteException;
//import android.support.v7.app.AlertController;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
private final static String TAG = "MainActivity";
DBHandler dbHandler = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.app.widget.RecycleView
android:id="@+id/esp_menu"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.app.widget.RecycleView>
<TextView
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" />
xml中的錯誤。 RecycleView而不是RecyclerView(缺少Recycler末尾的r字母)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.