我正在使用RecyclerView
和ParseRecyclerView
我创建了一个适配器来加载来自解析云的文本。我收到错误的视图无法应用于PhotoFilterViewHolder
。
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
final View view = LayoutInflater.from(context).inflate(R.layout.item_photo_filter, parent, false);
return new PhotoFilterViewHolder(view);
}
我正在使用PhotoFilterViewHolder查看Parse Cloud中的项目
public static class PhotoFilterViewHolder extends RecyclerView.ViewHolder {
public PhotoFilterViewHolder(FilterImages post, View view) {
super(view);
PlaceName = (TextView) view.findViewById(R.id.place_names);
PlaceName.setText(post.getPlaceName());
ButterKnife.bind(this, view);
}
}
答案 0 :(得分:0)
弄清楚错误!从PhotoFilterViewHolder中删除了FilterImages帖子
public static class PhotoFilterViewHolder extends RecyclerView.ViewHolder {
public PhotoFilterViewHolder(View view) {
super(view);
FilterImages post = new FilterImages();
PlaceName = (TextView) view.findViewById(R.id.place_names);
PlaceName.setText(post.getPlaceName());
ButterKnife.bind(this, view);
}
@ParseName("PlaceName")
public TextView PlaceName;
}
}
答案 1 :(得分:0)
返回"查看"对象而不是新的PhotoFilterViewHolder(view);