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