如何显示在活动标题栏的加载图标?
解决方案 @覆盖
公共无效的onCreate(包冰柱){
super.onCreate(冰柱);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
的setContentView(R.layout.your_layout);
}
则...在任何你想要的:
//然后,你可以做到这一点,以显示图标
setProgressBarIndeterminateVisibility(真正的);
//或隐藏它
setProgressBarIndeterminateVisibility(假);
请务必使用 requestWindowFeature
在的setContentView
。
How do you show a loading icon in the activity titlebar?
解决方案@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.your_layout);
}
Then... where ever you want:
// then, you can do this to show the icon
setProgressBarIndeterminateVisibility(true);
//or to hide it
setProgressBarIndeterminateVisibility(false);
Make sure to use requestWindowFeature
before setContentView
.