我再次推荐您访问我的 github。 https://github.com/gmck 您可以在其中找到使用 com.google.android.material.materialswitch.MaterialSwitch 的示例,它是旧 Switch 的现代替代品。