我想为我的产品销售实现这个进度条
我有总数和销售产品编号。我怎样才能用这个设计实现这个进度条?
我使用此代码
<ProgressBar
android:id="@+id/progressBarSell"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="80dp"
android:layout_height="10dp"
android:max="26"
android:progress="12" />
progressBarSell.setProgress(Total - Remaining);
progressBarSell.setMax(Total);
这很好
您可以使用 SeekBar 代替 ProgressBar,有关更多信息,请访问链接:
http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/ https://github.com/AndroSelva/Vertical-SeekBar-Android http:// /united-coders.com/nico-heid/an-android-seekbar-for-your-mediaplayer/
///////
seek6.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
public void onStopTrackingTouch(SeekBar seekBar) {
//TODO My code goes here
int CurrentLevel = seek6.getProgress();
if (CurrentLevel < 30) CurrentLevel = 30;
seek6.setProgress(CurrentLevel);
}
public void onStartTrackingTouch(SeekBar seekBar){
}
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser){
}
});