[英]Epoxy Processor Exception: Unable to get layout resource for view ModelView
I try to create Epoxy ModelView according to their Wiki documentation.我尝试根据他们的Wiki文档创建 Epoxy ModelView。 I am getting this error: "Epoxy Processor Exception: Unable to get layout resource for view TitleModel"我收到此错误:“环氧树脂处理器异常:无法获取视图 TitleModel 的布局资源”
This is my Java code:这是我的 Java 代码:
import ...
@ModelView
public class ModelViewA extends LinearLayout{
private TextView titleTextView;
@TextProp String title;
@CallbackProp @Nullable View.OnClickListener clickListener;
public ModelViewA(Context context) {
super(context);
inflate(getContext(), R.layout.title, this);
titleTextView = findViewById(R.id.title_text_view);
}
@AfterPropsSet
void postBindSetup() {
titleTextView.setText(title);
titleTextView.setOnClickListener(clickListener);
}
}
You have to put a PackageConfig interface in your Model class package:您必须在 Model class package 中放置一个 PackageConfig 接口:
package com.example;
import com.airbnb.epoxy.PackageModelViewConfig;
import com.example.R;
@PackageModelViewConfig(rClass = R.class)
public interface PackageConfig {}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.