2

我正在使用Jake的ActionBarSherlock和ViewPagerIndicator。 我意識到我無法在SherlockFragments中使用SherlockActivity設置setSupportProgressBarIndeterminate在SherlockFragments中使用SherlockActivity設置setSupportProgressBarIndeterminate

在SherlockActivity,我有

@Override 
protected void onCreate(Bundle arg0) { 
     super.onCreate(arg0); 
     requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); 
     setTheme(R.style.Theme_Sherlock_Light_DarkActionBar); 
     ActionBar actionbar = getSupportActionBar(); 
     actionbar.setDisplayHomeAsUpEnabled(true); 
     //setSupportProgressBarVisibility(true); 
    } 

在我SherlockFragment的的AsyncTask

@Override 
     protected void onPreExecute() { 
      getSherlockActivity().getSupportActionBar(); 
      getSherlockActivity().setSupportProgressBarVisibility(true); 
      getSherlockActivity().setSupportProgressBarIndeterminate(true); 
     } 

的進度不會出現。有什麼理由呢?

在此先感謝。

+0

檢查[顯示在Sherlock Action Bar中的不確定進度](http://stackoverflow.com/a/10615994) – 2013-04-25 14:13:49

回答

3

您需要使用setSupportProgressBarIndeterminateVisibility來進行不確定的進度條顯示。

+0

不要用'setSupportProgressBarIndeterminate'來弄錯... – 2014-08-24 13:07:10

相關問題