lundi 22 juillet 2019

if-else statement for xml

android studio xml. I am trying to create a if-else statement but it is not working.

<?xml version="1.0" encoding="utf-8"?>

<IF android:id = "@id/action_more">
    <item android:drawable="@color/design_default_color_primary"/>
</IF>
<ELSE>
    <item android:drawable="@color/colorPrimary" android:state_selected="true"/>
    <item android:drawable="@color/colorAccent"/>
</ELSE>

Aucun commentaire:

Enregistrer un commentaire