ProgressBar in ActionBar on Android L Preview

旧时模样 提交于 2019-12-08 16:58:42

问题


Today I started porting an app to Android L preview in order to have it almost ready when the final product launches. One problem I found is that I can't have an indeterminate progressbar on the ActionBar. It doesn't show at all and throws this error on logcat:

E/PhoneWindow﹕ Circular progress bar not located in current window decor

I'm using this code, which works in <4.4:

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

Is there any way to get it working again in Android L or should I use an external ProgressBar?


回答1:


I've just found this question and checked the bug report.

It seems that the dev team had concluded that the issue won't be fixed.

That is:

intended as the progress bar features are not supported on Material action bars.

The "Material action bar" should mean 4.4 (API19) or later's action bar.



来源:https://stackoverflow.com/questions/24823029/progressbar-in-actionbar-on-android-l-preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!