6

有人可以帮助我如何定义“字符串数组”类型的自定义属性,因为我找不到定义数组的格式。

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="MyCustomWidget">
        <attr name="myarray" format="string-array"/>
    </declare-styleable>
</resources>

这段代码似乎不起作用。我的“格式”应该是什么?

4

1 回答 1

6

而不是使用

    format="string-array"

我用了

    format="reference"

并将其引用到字符串数组资源。

于 2012-06-18T10:54:46.243 回答