android Window 之标题栏应用
(一)隐藏标题栏
在创建activity时默认有标题栏,如何隐藏掉呢?在Activity的onCreate()方法中调用 requestWindowFeature(Window.FEATURE_NO_TITLE); 或getWindow().requestFeature(Window.FEATURE_NO_TITLE);注意:必须在 setContentView(R.layout.main);方法之前调用以上方法!
(二)在标题栏显示环形进度条
有时我们需要在标题栏显示一个类似刷新的进度条,而不是ProgressDialog时,可以这样做:在Activity的onCreate()方法中调用requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);然后调用: setProgressBarIndeterminateVisibility(true); 显示进度。调用setProgressBarIndeterminateVisibility(false);关闭进度条。