带有工具提示的搜索栏 android [英] Seekbar with tooltip android

查看:52
本文介绍了带有工具提示的搜索栏 android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试使用工具提示自定义 android 搜索栏,例如给定的图像.有什么方法可以在搜索栏中使用拇指添加文本视图.或任何其他想法

I am trying to customize android seekbar with tooltip, like the given image. Is there any way to add the textview with the thumb in seekbar. or any other idea

谢谢

推荐答案

我们可以通过获得经验来做到这一点.并在seekbar的progressChanged中设置textview的x

We can do it by getting the bounds of thumb. and setting the x of textview in on progressChanged of seekbar

@Override
public void onProgressChanged(SeekBar seekBar, int progress,
        boolean fromUser) {

    mDistance.setText("" + AppConstants.getDistance() + " miles");
    //Get the thumb bound and get its left value
    int x = mSeekBar.getThumb().getBounds().left;
             //set the left value to textview x value
    mDistance.setX(x);
}

这篇关于带有工具提示的搜索栏 android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆