我有一组自定义的Android布局参数,它们在attrs.xml中定义。现在我想在styles.xml文件中使用一些标签。
目前我遇到了这个错误:
error: Error: No resource found that matches the given name: attr 'custom:tag'
我尝试声明自定义的XML命名空间,如下所示:
<resources
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/com.my.project"
>
希望可以在这里应用每个布局声明中使用的相同逻辑,但是没有成功。
<style name="my_style"> <item name="custom:tag">some_value</item> </style>
- Sergey Metlov