我尝试根据他们的Wiki文档创建 Epoxy ModelView。我收到此错误:“环氧树脂处理器异常:无法获取视图 TitleModel 的布局资源”
这是我的 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);
}
}