RecyclerView onCreateViewHolder Return Type Incompatibility With Multiple Custom ViewHolders
- 阅读更多 关于 RecyclerView onCreateViewHolder Return Type Incompatibility With Multiple Custom ViewHolders
问题 I'm trying to use multiple ViewHolders in a RecyclerView in order to swap these views out at run time. I have created two classes which extend RecyclerView.ViewHolder: MenuItemViewHolder public class MenuItemViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { public TextView menuItemText; public ImageView menuItemPhoto; public RecyclerViewAdapter rva; public MenuItemViewHolder(View itemView) { super(itemView); itemView.setOnClickListener(this); rva = caller;