how to set ToolTip Text in android custom seekbar?
You should have your customized textview
and change the text inside onProgressChanged
.
Is that enough? ==> No
You need to change the x
coordinate of the textview
to change it's place to be compatible with seekbar
place.
Code demonstrate that:
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
yourTextView.setText(progress + " miles");
// Get the thumb bound and get its left value
int x = seekBar.getThumb().getBounds().left;
// set the left value to textview x value
yourTextView.setX(x);
}