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.
有人可以告诉我如何在功能完成时自动选择复选框。我检查了一个条件,功能完成后,我需要自动查看选中的复选框。
提前致谢。
您可以从 xml 自动检查 CheckBox
<CheckBox android:id="@+id/checkbox1" . . . android:checked="true" />
或设置java代码,如
CheckBox cbCheckbox = (CheckBox)findViewById(R.id.checkbox1); cbCheckbox .setChecked(true);