unable to get right position of texBox in Thumb of seekbar
问题 I am working in android. I am designing a seekbar. I added thumb there. It is showing at right place. But at that thumb I want to show progress in text box. For this I am using this code: int xPos = ((seekbar.getRight() - seekbar.getLeft()) * seekbar.getProgress()) / seekbar.getMax(); But this x coordinate is not exact. It is a little bit different. Please suggest me what should I do for this. 回答1: You've calculated the distance along the seekbar, so you just need to add seekbar.getLeft()