简体   繁体   English

使用可绘制的Android自定义形状

[英]Android Custom shape using drawable

I wanted to create a step custom step indicator. 我想创建一个步骤自定义步骤指示器。 so I was looking for a way to create a custom shape maybe using drawable and set the text and color programatically. 所以我一直在寻找一种方法来创建自定义形状,也许使用drawable并以编程方式设置文本和颜色。 how can i make a custom shape like below: 我如何制作如下的自定义形状: 在此处输入图片说明 Note: I want to change color of the element based on the completed and current and remaining steps programatically. 注意:我想基于编程完成和当前以及其余步骤来更改元素的颜色。

You can use vector drawable to define the shape. 您可以使用矢量可绘制来定义形状。

You can use tinting on vector drawables. 您可以在矢量可绘制对象上使用着色 Or a ColorFilter for pre-lollipop devices 或用于棒棒糖前置设备的ColorFilter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM