android - 在 Seekbar 中使用 secondaryProgressTint 的目的是什么?
问题描述
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="200"
android:progress="50"
android:progressTint="#f00"
android:secondaryProgressTint="#ffff00"/>
我看到了这种SeekBar
支持secondaryProgressTint
,但在我设置它之后,它不会影响任何东西(在 Pixel 4XL 和三星 J7 上测试之后)。
此属性是否对某些设备或某些操作步骤有影响?
解决方案
secondaryProgressTint defines color for secondary progress in android seekbar.
for example
Find more from the ProgressBar documentation listed here: http://developer.android.com/reference/android/widget/ProgressBar.html#attr_android:secondaryProgress.
In ProgressBar
to show secondary progress, first define color for secondary progress by setting secondaryProgressTint attribute to the desired color.
<item name="android:secondaryProgressTint">#ffad00</item>
Then secondary secondaryProgress with secondary progress value using setSecondaryProgress(50);
.
Then progress bar will be shown like this:
推荐阅读
- flutter - Flutter 中的 CSS 格式化
- mysql - 使用mysql将选择请求结果转换为nodejs中的数组
- c++ - 如何将结构转换为无符号字符,反之亦然?
- swift - 错误:“某些视图”类型的值没有成员“中风”
- swift - 为什么这些简单的 Metal GPU 计算内核比 CPU 实现慢或相等?
- c++ - 在不运行程序的情况下获取 constexpr
- r - 在循环中创建对象并将其输入到函数中
- r - 我无法从这个管道操作中得到标准偏差
- python - Matplotlib 投影 3d 级别问题
- android - E/flutter(16289):[错误:flutter/lib/ui/ui_dart_state.cc(177)]未处理的异常:SocketException:套接字已关闭