如何在Activity标题栏中显示加载图标?
如何在Activity标题栏中显示加载图标?
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.your_layout);
}
然后...你想放在哪里就放在哪里:
// then, you can do this to show the icon
setProgressBarIndeterminateVisibility(true);
//or to hide it
setProgressBarIndeterminateVisibility(false);
在 setContentView
之前确保使用 requestWindowFeature
。