我一整天都在想这个问题,但似乎我就是想不出来。。。
好的,所以我添加了一个项目,一切都很好,正在工作。
为了"重新激活"它,我决定添加带有appcompat库的操作栏(如本文所述。
由于我添加了库,我无法再编译该项目,并且我不断收到以下错误:
C:UsersMeDocumentsDevMyProjectresvalueswidget_attributes.xml:9: error: Attribute "title" has already been defined
widget_attributes.xml如下所示:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="display" format="string" />
<attr name="lineWidth" format="dimension" />
<attr name="lineColor" format="color|reference" />
<attr name="fillColor" format="color|reference" />
<declare-styleable name="DigitalDisplay">
<attr name="title" format="string" />
<attr name="unit" format="string" />
<attr name="display" />
<attr name="valueFormat" format="string" />
<attr name="showUnitInValue" format="boolean" />
<attr name="showUnitInTitle" format="boolean" />
<attr name="valueIsTime" format="boolean" />
<attr name="titleTxtAppearance" format = "reference" />
<attr name="valueTxtAppearance" format = "reference" />
<attr name="unitTxtAppearance" format = "reference" />
</declare-styleable>
.../...
</resources>
当我使用自己的小部件时,我使用下面的符号:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:droidfa="http://schemas.android.com/apk/res/com.droidfa"
android:layout_width="match_parent"
android:layout_height="match_parent" >
我一定做错了什么,但我不知道是什么。。。
任何帮助或提示都将不胜感激。
提前感谢,JM
好吧,如果有一天有人读到这篇文章,我唯一能离开的方法就是重命名我自己的属性。。。