gpt4 book ai didi

android - 带有自定义缩略图和分段文本的 SeekBar

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:10:39 24 4
gpt4 key购买 nike

enter image description here

大家好,

我正在寻找像这张图片一样的搜索栏。我成功地设置了背景,但问题是拇指和搜索栏下方的分段文本。有谁知道解决方法谢谢你

最佳答案

使用 this library这是对我有用的最小示例代码:

<com.infteh.comboseekbar.ComboSeekBar
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="@+id/seekbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
custom:color="#000"
custom:textSize="12sp"
custom:multiline="false"
/>

然后在Activity中

private ComboSeekBar mSeekBar;
List<String> seekBarStep = Arrays.asList("All","1","5","10","20");
mDistanceSeekBar.setAdapter(seekBarStep);

这将使用默认可绘制对象创建一个黑色分段搜索栏。如果您需要添加一些自定义,请查看 ComboSeekBar.onDraw()CustomDrawable.draw()CustomThumbDrawable.draw()

该项目即将完成,但仍是一个坚实的起点。您可能需要更多地锻炼可绘制资源

关于android - 带有自定义缩略图和分段文本的 SeekBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16646898/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com