0
我需要應用程序中的特殊常量。資源項目會是這樣的:xml常量的自定義資源項類型
<resources>
<item type="myType" format="string" name="Name" >Some words</item>
<item type="myType" format="string" name="Name1" >Some words</item>
<item type="myType" format="string" name="Name2" >Some words</item>
</resources>
,我想打電話這樣說:
<ImageView
android:id="@+id/ID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/drawable"
android:contentDescription:"@myType/Name" />
任何想法如何做到這一點?我查了幾個網站,但沒有給我任何解決方案。 在此先感謝! :)
類型是預定義的,你不能創建你自己的。無論如何,你爲什麼要這麼做?看來你只是定義了字符串:'- 有些字
' –
kcoppock
2014-10-03 16:04:40