​自定义圆形仪表盘 View CircleRangeView

码农软件 · 软件分类 · Android UI 组件 · 2019-04-23 18:42:45

软件介绍

CircleRangeView是自定义圆形仪表盘View,适合根据数值显示不同等级范围的场景

一、效果图

二、用法

1.布局文件引入:

<com.ganxin.circlerangeview.CircleRangeView
        android:id="@+id/circleRangeView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:rangeColorArray="@array/circlerangeview_colors"
        app:rangeTextArray="@array/circlerangeview_txts"
        app:rangeValueArray="@array/circlerangeview_values"/>
  • 自定义属性:

  • rangeColorArray:等级颜色数组,必填

  • rangeValueArray:等级数值数组,数组长度同rangeColorArray保持一致,必填

  • rangeTextArray:等级文本数组,数组长度同rangeColorArray保持一致,必填

  • borderColor:外圆弧颜色,可选

  • cursorColor:指示标颜色,可选

  • extraTextColor:附加文本颜色,可选 

  • rangeTextSize:等级文本字体大小,可选 

  • extraTextSize:附加文本字体大小,可选

2.在你的onCreate方法或者fragment的onCreateView方法中,根据id绑定该控件

 CircleRangeView circleRangeView= (CircleRangeView) findViewById(R.id.circleRangeView);

3.在合适的时机,调用方法给控件设值

    List<String> extras =new ArrayList<>();
    extras.add("收缩压:116");
    extras.add("舒张压:85  ");

    //circleRangeView.setValueWithAnim(value);
    circleRangeView.setValueWithAnim(value,extras);

本文地址:https://www.codercto.com/soft/d/4231.html

CSS3 Solutions

CSS3 Solutions

Marco Casario / Apress / 2012-8-13 / GBP 35.50

CSS3 brings a mass of changes, additions, and improvements to CSS across a range of new modules. Web designers and developers now have a whole host of new techniques up their sleeves, from working wit......一起来看看 《CSS3 Solutions》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换