​自定义圆形仪表盘 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://codercto.com/soft/d/4231.html

The Golden Ticket

The Golden Ticket

Lance Fortnow / Princeton University Press / 2013-3-31 / USD 26.95

The P-NP problem is the most important open problem in computer science, if not all of mathematics. The Golden Ticket provides a nontechnical introduction to P-NP, its rich history, and its algorithmi......一起来看看 《The Golden Ticket》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具