RecyclerView
recycleview的使用需要在V-7的环境下,需要添加相关的依赖
在style.xml文件中,parent中添加Base.
因为我的as 的版本比较高(29),recycleview的V-7依赖包的方式,我采用的实在build.gradle(Module:app)中添加了如下的几行代码
adapter.java
package com.example.myapplication5;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
public class adapter extends RecyclerView.Adapter<adapter.myviewholder> {
private List<String> list;
private Context context;
private View inflater;
public adapter(Context context,List<String> list){
this.list =list;
this.context=context;
}
@Override
public myviewholder onCreateViewHolder<