Android 使用数据绑定时,获取错误“与属性着色(attr)颜色不兼容”

Android 使用数据绑定时,获取错误“与属性着色(attr)颜色不兼容”,android,android-databinding,Android,Android Databinding,我试图在运行时使用数据绑定设置图像的着色颜色 <ImageView android:id="@+id/txtAppointmentEnable" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src='@{paymentMethod.getActiveStatus().equalsIgnoreCase("

我试图在运行时使用数据绑定设置图像的着色颜色

    <ImageView
        android:id="@+id/txtAppointmentEnable"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src='@{paymentMethod.getActiveStatus().equalsIgnoreCase("DISABLE") ?  @drawable/ic_action_navigation_close : @drawable/ic_add_white_36dp}'
        android:tint='@{paymentMethod.getActiveStatus().equalsIgnoreCase("DISABLE") ?  @color/favourite_red : @color/green_light'/>
这个问题的可能解决方案是什么。

最后再加一句

<ImageView
        android:id="@+id/txtAppointmentEnable"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src='@{paymentMethod.getActiveStatus().equalsIgnoreCase(`DISABLE`) ?  @drawable/ic_action_navigation_close : @drawable/ic_add_white_36dp}'
        android:tint='@{paymentMethod.getActiveStatus().equalsIgnoreCase(`DISABLE`) ?  @color/favourite_red : @color/green_light}'/>
最后只需添加}

<ImageView
        android:id="@+id/txtAppointmentEnable"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src='@{paymentMethod.getActiveStatus().equalsIgnoreCase(`DISABLE`) ?  @drawable/ic_action_navigation_close : @drawable/ic_add_white_36dp}'
        android:tint='@{paymentMethod.getActiveStatus().equalsIgnoreCase(`DISABLE`) ?  @color/favourite_red : @color/green_light}'/>

您没有关闭“}”,请在结尾处添加大括号:@颜色/绿光}哦,是的。谢谢@iqiГööццimk_如果我的评论对你有帮助的话,你可以对它投赞成票;您没有关闭“}”,请在结尾处添加大括号:@颜色/绿光}哦,是的。谢谢@iqiГööццimk_如果我的评论对你有帮助的话,你可以对它投赞成票;