📅  最后修改于: 2022-03-11 14:52:42.508000             🧑  作者: Mango
// To check a switch
switchMaterial.isChecked = true
// To listen for a switch's checked/unchecked state changes
switchMaterial.setOnCheckedChangeListener { buttonView, isChecked
// Responds to switch being checked/unchecked
}