我为android平台编写了代码。我在 .java 文件和 sound.xml 中声明了变量 sound_on_state 整数变量,我编写了以下代码,
enter code here
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<xsl:if sound_on_state > 0> /*this line give error as android prefix namespace*/
<item android:drawable="@drawable/sound_on_02" android:duration="50"/>
<item android:drawable="@drawable/sound_on_01" android:duration="50"/>
<xsl:else>
<item android:drawable="@drawable/sound_off_02" android:duration="50"/>
<item android:drawable="@drawable/sound_off_01" android:duration="50"/>
</xsl:else>
</xsl:if>
</animation-list>