我正在尝试在 Material Design 组件中使用 slider ,但在设置拇指样式时卡住了。
我的设计要求需要围绕拇指的阴影。
从文档中仅显示如何更改背景拇指。
是否可以用图像更改拇指?
最佳答案
目前它在测试版中实现。
https://github.com/material-components/material-components-android/commit/17da000a295a4a2554b603940ce014ff6a18da45
已编辑。
测试版中添加的方法:
setCustomThumbDrawable(@NonNull Drawable drawable)
setCustomThumbDrawable(@DrawableRes int drawableResId)
setCustomThumbDrawablesForValues(@NonNull @DrawableRes int... customThumbDrawableResIds)
setCustomThumbDrawablesForValues(@NonNull Drawable... customThumbDrawables)
关于android - 如何用图像更改 Slider 的拇指 Material Component Android?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64640669/