我在布局文件中使用了以下代码来根据应用程序的风格类型更改两种不同的视图可见性。我没有看到调试版本有任何问题,但我认为发布版本存在问题,因为据报道这两个视图在测试版本中都是可见的。知道为什么会发生这种情况吗?
<Switch
android:id="@+id/configuration_main_network_switch"
style="@style/networkSelector"
android:visibility="@{BuildConfig.FLAVOR.equals(`xxxx`) ? View.GONE : View.VISIBLE}"
android:text="@{configurationMainNetworkSwitch.checked ? @string/network_configuration_main_wifi_enabled_button : @string/network_configuration_main_wifi_disabled_button}" />
<TextView
android:id="@+id/configuration_main_network_switch_gone"
style="@style/networkSelector"
android:visibility="@{BuildConfig.FLAVOR.equals(`xxxx`) ? View.VISIBLE : View.GONE}"
android:text="@string/network_configuration_main_wifi_enabled_button"/>