无法识别Android自定义库模块BindingAdapter属性
所以我刚刚学习了如何通过Github和JitPack发布我自己的库(只是一些实用程序函数),下面是我的代码: 我的问题是,无法识别Android自定义库模块BindingAdapter属性,android,android-databinding,android-library,jitpack,android-binding-adapter,Android,Android Databinding,Android Library,Jitpack,Android Binding Adapter,所以我刚刚学习了如何通过Github和JitPack发布我自己的库(只是一些实用程序函数),下面是我的代码: 我的问题是,Double.roundDecimal()被识别,但我的自定义数据绑定属性isAddCase未被识别,显示AAPT:error:attribute isAddCase(又名com.example.shapeableimageviewtest:isAddCase)未找到。 我尝试了一个新项目: <layout xmlns:android="http:/
Double.roundDecimal()
被识别,但我的自定义数据绑定属性isAddCase
未被识别,显示AAPT:error:attribute isAddCase(又名com.example.shapeableimageviewtest:isAddCase)未找到。
我尝试了一个新项目:
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="name"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{name}"
app:isAddCase="true"/> //either "isAddCase" or "app:isAddCase", doesn't work
</LinearLayout>
</layout>
//“isAddCase”或“app:isAddCase”都不起作用
您必须使用app:isAddCase=“@{true}”
更改app:isAddCase=true
您太棒了!!