如何解决此错误?//数据类中的setter函数
fun setSize(editable: Editable) {
editable.toString().toDoubleOrNull()?.let { size = it }
}
在xml 中
<EditText
android:afterTextChanged="@{Text -> shoeListingsViewModel.shoe.setSize(Text)}" />
我认为您在text参数中缺少副题。
android:afterTextChanged="@{(text) -> shoeListingsViewModel.shoe.setSize(text)}" />