我想为我的产品销售实施此进度条
我有总数和销售产品编号。如何使用此设计实现此进度条?
答案 0 :(得分:4)
我使用此代码
<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);
这很好用
答案 1 :(得分:0)
您可以使用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){
}
});