android 豎向滑動刻度

VerticalScaleView介紹

豎向刻度:尺實現豎着的滑動刻度,支持自定義初始值、最大值、最小值,支持慣性滑動……java

github

https://github.com/supertaohaili/VerticalScaleViewgit

效果圖

20190618.jpg

使用

verticalRullView.setMin(0);   //設置刻度尺最小值
        verticalRullView.setMax(255);   //設置刻度尺最大值
        verticalRullView.setInterval(10);   //設置刻度尺的間距
        verticalRullView.setTextOffset(20); //根據顯示的數字自主調節刻度尺數字的左右位置
        verticalRullView.setRuleListener(new VerticalScaleView.ScaleCallback() {
            @Override
            public void onScaleSelected(int length, int value) {
                //得到即時顯示的數字
                tVertical.setText(String.valueOf(value));
            }
        });

Known Issues

If you have any questions/queries/Bugs/Hugs please mail @ taohailili@gmail.comgithub

相關文章
相關標籤/搜索