我有SeekBar有3个值(左边,中间和右边),我想在progess级别放置一些标记,例如在中心,将垂直线放在条形或类似的东西上.
这是可能的还是使用一些不同的组件可能会更好?
就像在这张图片上,我需要像这条红线一样的东西

您可以使用 setBackgroundDrawable(Drawable d)。将您想要的标签内容保存为 png 图像,然后将其添加到项目中的资源中。
这是我使用的一些代码,其中我的图像是 android 启动器图标:
seekbar = (SeekBar) findViewById(R.id.seekBar1);
Resources r = getResources();
Drawable d = r.getDrawable(R.drawable.ic_launcher);
seekbar.setBackgroundDrawable(d);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1434 次 |
| 最近记录: |