当前位置:网站首页 > 技术博客 > 正文

android seekbar



Dis

cre

te SeekBar

是一个Ma

te

rial Design风格的、带有气泡指示器的拖动条。可以

自定义 样式

,非常不错的东西。项目地址:https://github.com/AnderWeb/

dis

cre

te SeekBar

效果图:使用起来也非常简单如何使用xml中创建<org.adw.library.widgets.

dis

cre

te seekbar

.

Dis

cre

te SeekBar

        

android

:id="@ id/

dis

cre

te

"

        

android

:layout_width="match_parent"

        

android

:layout_height="wrap_con

te

nt"

        app:dsb_min="1"

        app:dsb_max="100"

        app:dsb_value="20"

        app:dsb_indicatorFormat

te

r="d"

        />2. java

Dis

cre

te SeekBar

dis

cre

te SeekBar

= (

Dis

cre

te SeekBar

) findViewById(R.id.

dis

cre

te

);

//设置浮动气泡的值,每次进度值改变时,都会触发

dis

cre

te SeekBar

.setNumericTransformer(new

Dis

cre

te SeekBar

.NumericTransformer() {

            @Override

            public int transform(int value) {

                return value * 10;

            }

        });

//进度值变化监听

dis

cre

te SeekBar

.setOn

Progress

ChangeLis

te

ner(new

Dis

cre

te SeekBar

.On

Progress

ChangeLis

te

ner(){

            public void on

Progress

Changed(

Dis

cre

te SeekBar

seekBar

, int value, boolean fromUser){

            }

            public void onStartTrackingTouch(

Dis

cre

te SeekBar

seekBar

){

            }

            public void onStopTrackingTouch(

Dis

cre

te SeekBar

seekBar

){

            }

        });属性说明属性名类型使用说明dsb_minin

te

ger|dimension最小进度值dsb_maxin

te

ger|dimension最大进度值dsb_valuein

te

ger|dimension当前进度值dsb_mirrorForRtlboolean由于某些语言,比如阿拉伯语、希伯来语,是“从右往左”显示的,和中文、英语……是相反的。所以该属性的含义是,是否根据本地语言进行反向。dsb_allowTrackClickToDragboolean是否允许通过点击进度条上某一点,来改变进度值。默认是truedsb_

progress

Colorcolor|reference设置进度条及滑块(thumb)的颜色dsb_trackColorcolor|reference设置背景条(track)的颜色dsb_indicator

Te

xtAppearancereference设置气泡(bubble)的

样式

dsb_indicatorColorcolor|reference设置气泡(bubble)的背景色dsb_indicatorElevationdimension很抱歉,这个属性我也不知道怎么用。rela

te

d to

android

:elevation. Will only be used on API level 21 dsb_indicatorFormat

te

rstring|reference设置气泡指示器文字的格式dsb_rippleColorcolor|reference设置触碰点波动的颜色dsb_indicatorPopupEnabledboolean是否显示气泡指示器

  • 上一篇: html的表单元素
  • 下一篇: 交叉验证模型
  • 版权声明


    相关文章:

  • html的表单元素2025-05-03 19:30:02
  • phython怎么入门2025-05-03 19:30:02
  • 激活函数sigmod2025-05-03 19:30:02
  • css弹性盒模型2025-05-03 19:30:02
  • vscode断点调试失效2025-05-03 19:30:02
  • 交叉验证模型2025-05-03 19:30:02
  • js数组删除2025-05-03 19:30:02
  • 图形验证码到底有什么用2025-05-03 19:30:02
  • ifconfig和ip a2025-05-03 19:30:02
  • redis集群切片的三种方式2025-05-03 19:30:02