ProgressBar.setProgressDrawable not working for Android 2.3 -


I am currently working with dynamically updated ProgressBar . Through a few percentages, the prawnsbar sets the color of a different color. Currently we have various color clips defined in drawable XML. The one entitled progressbar_blue_states is as detailed:

   & Lt; / Item & gt; & Lt; / Layer-list & gt;   

Whenever we need to update the dialog, we call the following code:.

  progressBar.setProgressDrawable (getResources () getDrawable (R.drawable.progressbar_blue_states));   

However, it does not only update the progress bar, but it completely takes the progress bar out where the white space is left anywhere. However, if I set android: progressDrawable = "@ drawable / progressbar_blue_states" are in XML and carry this call setProgressDrawable () , it loads correctly. We need setprogressDrawable to update the colors as needed.

This call works fine in Android 4.0+, but in Android 2.3 we are running in some trouble. Any ideas?

Edit

In this way we set up progress in XML:

  : indefinite = "false" android: indeterminateOnly = "false"    

I got the same bug, but it has been resolved by using < / P>

This means there is a new drawable set for the seekbar, but the drawable size is 0, so you will not see anything.

  Rect range = mySeekBar.getProgressDrawable (). GetBounds (); MySeekBar.setProgressDrawable (newSeekBarBackground); MySeekBar.getProgressDrawable () setBounds (border)    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -