【发布时间】:2013-10-02 02:28:44
【问题描述】:
我为安卓平台编写了代码。 我在 .java 文件中声明变量 sound_on_state 整数变量 在我的 sound.xml 中,我编写了以下代码,
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>
【问题讨论】: