【问题标题】:Custom Attributes of array type数组类型的自定义属性
【发布时间】:2012-06-19 06:37:30
【问题描述】:

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

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

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

【问题讨论】:

    标签: android xml custom-attributes


    【解决方案1】:

    而不是使用

        format="string-array"
    

    我用过

        format="reference"
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-25
      • 1970-01-01
      相关资源
      最近更新 更多