<resources>
<!--声明公共属性-->
<attr name="radius" format="dimension" />
<attr name="topLeftRadius" format="dimension" />
<attr name="topRightRadius" format="dimension" />
<attr name="bottomRightRadius" format="dimension" />
<attr name="bottomLeftRadius" format="dimension" />
<declare-styleable name="ShapeButton">
<attr name="solidColor" format="color" />
<attr name="strokeColor" format="color" />
<attr name="strokeWidth" format="dimension" />
<attr name="radius"/>
<attr name="topLeftRadius"/>
<attr name="topRightRadius"/>
<attr name="bottomRightRadius"/>
<attr name="bottomLeftRadius"/>
</declare-styleable>
<declare-styleable name="SelectorButton">
<attr name="radius"/>
<attr name="topLeftRadius"/>
<attr name="topRightRadius"/>
<attr name="bottomRightRadius"/>
<attr name="bottomLeftRadius"/>
</declare-styleable>
</resources>
Android中attrs属性复用
最新推荐文章于 2021-07-07 13:33:03 发布