是否可以将样式属性定义为必需? (如在 XSD 模式中)
<declare-styleable name="PieChart">
<attr name="name" format="string" use="required"/>
</declare-styleable>
上面的XML不行,有没有别的语法可以实现?
最佳答案
如果在 attr 值为 null 时在构造函数中抛出异常怎么办?
关于android - 为 <declare-stylable> 定义一个必需的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16148696/