Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, Progress Bar under ActionBar, and remove circle progress

I am using ActionBarSherlock, and using custom view for the action bar and i want to make progress bar, using this code

requestWindowFeature(Window.FEATURE_PROGRESS);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_main);
setSupportProgressBarIndeterminateVisibility(true);
setProgressBarIndeterminate(true);

but somehow the progress bar is appear above the action bar and also it put a circle progress indication at left most of action bar,

how to put the progress bar under the action bar and remove the circle indicator?

thank you

the layout i want

like image 260
DeckyFx Avatar asked Nov 29 '13 07:11

DeckyFx


People also ask

How do I stop indeterminate progress bar?

You can set your progressbar's visibility to invisible or gone through progressbar. setVisibility(View. INVISIBLE); or progressBar.

What are the different types of progress bars?

There are 2 types of progress bars: determinate and indeterminate. The former is used when the amount of information that needs to be loaded is detectable. The latter is used when the system is unsure how much needs to be loaded or how long it will take.


1 Answers

The reason for the circle, is this line of code.

requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

And as for the progressbar this should enable it.

requestWindowFeature(Window.FEATURE_PROGRESS);

As you've already done, what you need now is to alter it.

look here for an example.

For a similar question with a good answer look here.

like image 117
ASamsig Avatar answered Sep 27 '22 18:09

ASamsig