samedi 10 novembre 2018

Android - How to add a default checked CheckBox to Navigation Drawer

I want to add a check box to Navigation Drawer, and I want one of them to be default checked

I'm using this: app:actionViewClass="android.widget.Switch" as suggested in this answer.

But I couldn't figure out how to make one of them default checked. If I use this property android:checked="true", then the option is checked instead of checkbox (See image).

enter image description here

Does anyone know how to make it default checked (if possible, I want to do it in XML only)?




Aucun commentaire:

Enregistrer un commentaire