Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在切换组中有很多子按钮。而且我希望每当点击其中一个孩子时,使整个切换组不可点击。
您可以使用OnButtonCheckedListener()监听器:
OnButtonCheckedListener()
materialButtonToggleGroup.addOnButtonCheckedListener { group, checkedId, isChecked -> for (i in 0 until materialButtonToggleGroup.childCount) { materialButtonToggleGroup.getChildAt(i).isClickable = false } }