How to add progressbar to ActionBarSherlock

前端 未结 3 2219
野趣味
野趣味 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:41

    For full compatibility you should use:

    setSupportProgressBarIndeterminateVisibility(true);
    

    Here is an example:

    public class MyActivity extends SherlockFragmentActivity {
        //...
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);     
            requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);        
            setContentView(R.layout.my_layout);
            //...
            setSupportProgressBarIndeterminateVisibility(true);
        }
    }
    

提交回复
热议问题