2017-08-17 41 views

回答

0

我最終這樣做,不太清楚該怎麼做5。減號5恰好是錶盤x位置的中心。

// tipBar is the seekbar. 
int [] location = new int[2]; 
tipBar.getLocationInWindow(location); 
int x = location[0] + tipBar.getThumb().getBounds().centerX() + tipBar.getThumbOffset() - 5; // magic 5 
int y = location[1] + tipBar.getThumb().getBounds().centerY(); 
+0

這可能會幫助你,https://stackoverflow.com/questions/10451838/get-onscreen-position-of-current-seekbar-progress-secondary-progress –

相關問題