android 横向stepview,Android 流程指示器 StepView

本文介绍了如何在Android平台上使用StepView组件来创建自定义的流程指示器。通过设置不同的属性,如完成的步数、线条颜色、文字颜色以及图标等,可以实现对流程指示器的个性化定制,以展示应用程序的不同状态。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

软件介绍

StepView 是Android平台下自定义的流程指示器。

效果图:

ced717ed9dd97cf49f1f2068a943bcee.png

624d506d3e9424fd1a4ceff9d7e6e016.png

使用:

android:id="@+id/step_view0"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_centerInParent="true"

android:textColor="@android:color/white"

android:textSize="14sp"

/>StepView setpview0 = (StepView) findViewById(R.id.step_view0);

List list0 = new ArrayList<>();

list0.add("接单");

list0.add("出发");

list0.add("开始");

list0.add("结束");

list0.add("完成");

setpview0.setStepsViewIndicatorComplectingPosition(2)//设置完成的步数

.setStepViewTexts(list0)//总步骤

.setStepsViewIndicatorCompletedLineColor(ContextCompat.getColor(getBaseContext(), android.R.color.white))//设置StepsViewIndicator完成线的颜色

.setStepsViewIndicatorUnCompletedLineColor(ContextCompat.getColor(getBaseContext(), R.color.uncompleted_text_color))//设置StepsViewIndicator未完成线的颜色

.setStepViewComplectedTextColor(ContextCompat.getColor(getBaseContext(), android.R.color.white))//设置StepsView text完成线的颜色

.setStepViewUnComplectedTextColor(ContextCompat.getColor(getBaseContext(), R.color.uncompleted_text_color))//设置StepsView text未完成线的颜色

.setStepsViewIndicatorCompleteIcon(ContextCompat.getDrawable(getBaseContext(), R.drawable.complted))//设置StepsViewIndicator CompleteIcon

.setStepsViewIndicatorDefaultIcon(ContextCompat.getDrawable(getBaseContext(), R.drawable.default_icon))//设置StepsViewIndicator DefaultIcon

.setStepsViewIndicatorAttentionIcon(ContextCompat.getDrawable(getBaseContext(), R.drawable.attention));//设置StepsViewIndicator AttentionIcon

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值