只是为了方便copy <import type="android.view.View"/> android:visibility="@{viewModel.state == 2 ? View.VISIBLE : View.GONE}"