How to add progressbar to ActionBarSherlock

前端 未结 3 2226
野趣味
野趣味 2020-12-06 19:05

Is it possible to add progressbar to ActionBarSherlock? I need to show and hide it in particular time. But it has to be located inside ActionBarSherlock.

Code of my

3条回答
  •  日久生厌
    2020-12-06 19:56

    Yes. You can add a ProgressBar to an ActionBar using ABS.

    This is an extract from the source provided below, if the solutions helps, +1 the original poster ;-)

    In your onCreate() method, add this piece of code:

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);  
    setProgressBarIndeterminateVisibility(true);
    

    And when you are done with the task that you need to display the ProgressBar for, hide the ProgressBar using this code:

    setProgressBarIndeterminateVisibility(false);
    

    Credit: https://stackoverflow.com/a/9157874/450534

提交回复
热议问题