android - 在 Material slider 上隐藏拇指

标签 android material-components-android android-slider

我正在从 AppCompatSeekBar 迁移到 material.slider.Slider

使用 splitTrack="false" 可以轻松移除 SeekBar 上的拇指。

如何使用 Slider 实现同样的效果?

最佳答案

您可以使用属性:

  • app:haloRadius
  • app:thumbRadius

要避免光环,您可以使用 app:haloRadius。使用 10dp 作为 thumbRadius:

        <com.google.android.material.slider.Slider
            app:haloRadius="10dp"
            ../>

enter image description here

您还可以使用属性 app:thumbRadius="0dp"

移除缩略图和光晕
       <com.google.android.material.slider.Slider
            app:thumbRadius="0dp"
            app:haloRadius="0dp"
            ..../>

enter image description here

关于android - 在 Material slider 上隐藏拇指,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66797254/

相关文章:

java - Sqlite数据库不会复制到真实设备的sd卡中

android - 此 Kotlin 代码无法访问 Handler()postDelayed,如何解决?

android - 更改对话框按钮颜色

android - 芯片 : The style on this component requires your app theme to be Theme. MaterialComponents(或后代)

android - 如何将 Flow<CustomType> 转换为 StateFlow<UIState>? - 安卓 Kotlin

java - 获取所选元素内的所有元素作为 Element Jsoup android 的数组

android - 显示填充颜色的底部导航菜单项。我想显示我在可绘制文件夹中添加的确切图标

android - 为 Sliders 实现 Google 设计指南

android - 自定义搜索栏(拇指大小、颜色和背景)

android - Android 的 Material 组件 slider 有两个大拇指?