如果ViewGroup Kotlin语言中有任何值,如何更改ViewGroup上的可见性?

时间:2019-03-27 08:05:45

标签: kotlin view visibility

我想将Groupview.visibility = View.VISIBLE更改为GroupView.visibility = View.GONE。代码应该如何?

这是我的Activity.kt

if (viewModel.inputPosTableArea1.value !=  "") {
    btn_addtable1?.visibility = View.GONE
    table2?.visibility = View.VISIBLE
    btn_addtable2?.visibility = View.VISIBLE
}

我希望当“添加”按钮被“单击”时,它将变为如下所示:

btn_addtable1.visibility = View.GONE
table2.visibility = View.VISIBLE
btn_addtable2.visibility = View.VISIBLE

0 个答案:

没有答案