android - AndroidX recyclerview 1.0.0 vs 1.1.0 问题
问题描述
我最近将 recyclerview 1.0.0 更新为 1.1.0
一切似乎都运行良好,但现在我收到了一些罕见的崩溃报告,即视图为空
现在我设法在底部的表格中复制它,里面有一个 recyclerview
@BindView(R.id.earningTitleTextView)
TextView earningTitleTextView;
@BindView(R.id.earningAmountTextView)
TextView earningAmountTextView;
public KeEarningItemViewHolder(View itemView) {
super(itemView);
this.context = itemView.getContext();
ButterKnife.bind(this, itemView);
}
public void setContent(KeEarnings.KeEarningItem earningItem){
if(earningTitleTextView != null){
earningTitleTextView.setText(earningItem.getTitle());
}
if(earningAmountTextView != null){
earningAmountTextView.setText(earningItem.getValue());
}
}
setContent 在 onBindViewholder 方法中被调用,但似乎绑定发生在 viewHolder 完全创建之前?!EarningTitleTextView 和 EarningAmountTextView 都是空的
是否有什么完全改变了如何处理我错过的 Viewholder 或者只是新的 Recyclerview 1.1.0 中的一个错误?
解决方案
推荐阅读
- webforms - 命名空间“Telerik”中不存在类型或命名空间名称“WinContols”
- php - 在列中回显 JSON 值
- javascript - getComputedStyle() 跨浏览器的一致性
- java - 在存在 XFF 标头的情况下将 `AuthenticationFailureBadCredentialsEvent` 与远程地址相关联
- abap - SAP Gateway:如何设置服务以直接访问 ABAP 功能,而不需要任何实体?
- google-bigquery - 如何在 BigQuery 中使用路径重命名列?
- php - ruby 到 php 的签名
- javascript - Babel CLI 更改 out-dir 的文件名
- angular - 自定义角度指令不适用于插值
- python - Why is my logistic regression model predicting 0s only? /small sample size?