Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法识别Android自定义库模块BindingAdapter属性_Android_Android Databinding_Android Library_Jitpack_Android Binding Adapter - Fatal编程技术网

无法识别Android自定义库模块BindingAdapter属性

无法识别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:/

所以我刚刚学习了如何通过Github和JitPack发布我自己的库(只是一些实用程序函数),下面是我的代码:

我的问题是,
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

您太棒了!!