We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixt this Exception you need to custom MultiItemTypeAdapter
fixit code
` @OverRide public int getItemViewType(int position) { try { return super.getItemViewType(position); }catch (Exception e){ return -1; } } @OverRide public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType==-1){ Log.e("---",viewType+"**"); ItemViewDelegate itemViewDelegate = new EmptyDelegate(); int layoutId = itemViewDelegate.getItemViewLayoutId(); ViewHolder holder = ViewHolder.createViewHolder(mContext, parent, layoutId); onViewHolderCreated(holder,holder.getConvertView()); setListener(parent, holder, viewType); return holder;
} return super.onCreateViewHolder(parent, viewType); } @Override public void convert(ViewHolder holder, Object o) { try { super.convert(holder, o); }catch (Exception e){ } }
`
The text was updated successfully, but these errors were encountered:
EmptyDelegate() is height and width is 0dp layout
Sorry, something went wrong.
正想提出这个问题,源码在找不到itemtype的情况直接抛出错误 似乎太粗暴 是不是在这种情况提供一个设置自定义空的itemtype的方法来兜底比较好。或者就只能像楼上的兄弟一样自定义处理
No branches or pull requests
fixt this Exception you need to custom MultiItemTypeAdapter
fixit code
`
@OverRide
public int getItemViewType(int position) {
try {
return super.getItemViewType(position);
}catch (Exception e){
return -1;
}
}
@OverRide
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType==-1){
Log.e("---",viewType+"**");
ItemViewDelegate itemViewDelegate = new EmptyDelegate();
int layoutId = itemViewDelegate.getItemViewLayoutId();
ViewHolder holder = ViewHolder.createViewHolder(mContext, parent, layoutId);
onViewHolderCreated(holder,holder.getConvertView());
setListener(parent, holder, viewType);
return holder;
`
The text was updated successfully, but these errors were encountered: