2

I've next problem. I create next attr.xml :

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="PublicMap">
        <attr name="public_map" format="boolean"/>
    </declare-styleable>
    <declare-styleable name="SceneMap">
        <attr name="public_map" format="boolean"/>
        <attr name="preview_mode" format="boolean"/>
    </declare-styleable>
</resources>

now project can not be compiled. Error is "error: Attribute "public_map" has already been defined". Is not possible to declare attributes with the same name for different views?

4

1 回答 1

0

我在我的一个项目上对此进行了测试,并注意到它不可能attr不同的declare-styleable.

但是,您可以附加前缀以区分具有相似名称的属性。

于 2012-07-31T14:19:37.750 回答