学习了ListView控件之后,接着开始了RecyclerView控件的探索,在学习得过程中发现了些不理解的问题,贴出代码和问题做些记录。
- 这是RecyclerView的适配器部分
- 没有贴出的部分有Brother类(定义了照片和姓名)
- 主布局和子项布局
- 主方法
public class BrotherAdapter extends RecyclerView.Adapter<BrotherAdapter.ViewHolder> {
private List<Brother> mBrotherList;
static class ViewHolder extends RecyclerView.ViewHolder {
ImageView brotherPicture;
TextView brotherDescription;
public <