Cannot find a setter for <com.scwang.smart.refresh.footer.ClassicsFooter app:loadingText> that accepts parameter type 'me.hgj.jetpackmvvm.callback.databind.StringObservableField' If a binding adapter provides the setter, check that the adapter is annotat
时间: 2024-04-13 13:30:20 浏览: 93
Vue.js v-for 指令:深入探究限制与最佳实践
ed correctly and that the parameter type matches.
To resolve this issue, you need to create a binding adapter that accepts the parameter type 'me.hgj.jetpackmvvm.callback.databind.StringObservableField' for the loadingText attribute of the ClassicsFooter in your XML layout.
Here's an example of how the binding adapter can be implemented:
```java
@BindingAdapter("app:loadingText")
public static void setLoadingText(ClassicsFooter classicsFooter, StringObservableField loadingText) {
classicsFooter.setLoadingText(loadingText.get());
}
```
Make sure to annotate the binding adapter method with the `@BindingAdapter` annotation and provide the attribute name as the parameter.
After creating the binding adapter, you should be able to use the loadingText attribute with a StringObservableField in your XML layout without any errors.
阅读全文