如何创建具有多种视图类型的RecyclerView?
从 https://developer.android.com/preview/material/ui-widgets.html 当我们创建时,RecyclerView.Adapter我们必须指定ViewHolder将与适配器绑定。 public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private String[] mDataset; public MyAdapter(String[] myDataset) { mDataset = myDataset; } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView mTextView; public ViewHolder(TextView v) { super(v); mTextView = v; } } @Override public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v …