尝试调用虚方法:
void android.widget.Button.setTag(java.lang.Object)
在null对象引用上。
androiddataBinding
时出现错误:
<Button
android:id="@+id/btn_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp"
android:background="@{userInfo.isEmpty?@drawable/shape_gray_corner:@color/colorWhite}"
android:text="@string/text_login"
android:onClick="onViewClik"
android:textColor="@color/colorWhite"
android:textSize="@dimen/textsize_24" />
答案 0 :(得分:0)
我认为你必须尝试默认颜色而不是drawable 或者在两个地方使用drawable。
像这样android:background="@{userInfo.isEmpty ? @color/colorYellow : @color/colorWhite}"