这篇文章给大家介绍在Android中icon+控件实现文字的多种效果,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
第一步 自定义属性
在res/values/目录下新建attrs.xml文件,
添加如下属性
<attr name="backColor" format="color" /> <attr name="backColorPress" format="color" /> <attr name="textColor" format="color" /> <attr name="textColorPress" format="color" /> <declare-styleable name="ButtonExtendM"> <attr name="backColor"/> <attr name="backColorPress"/> <attr name="textColor"/> <attr name="textColorPress"/> <attr name="iconDrawable" format="reference" /> <attr name="iconDrawablePress" format="reference" /> <attr name="text" format="string" /> <attr name="textSize" format="float" /> <attr name="spacing" format="dimension" /> <attr name="style"> <enum name="iconLeft" value="0" /> <enum name="iconRight" value="1" /> <enum name="iconUp" value="2" /> <enum name="iconBottom" value="3" /> </attr> </declare-styleable>
标题名称:在Android中icon+控件实现文字的多种效果-创新互联
转载注明:https://www.cdcxhl.com/article26/dcojjg.html
成都网站建设公司_创新互联,为您提供云服务器、品牌网站建设、ChatGPT、Google、外贸网站建设、营销型网站建设
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联