1、隐藏标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);

2、在标题栏显示进度条
requestWindowFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.progressbar_1);
setProgressBarVisibility(true);

final ProgressBar progressHorizontal = (ProgressBar) findViewById(R.id.progress_horizontal);
setProgress(progressHorizontal.getProgress() * 100);
setSecondaryProgress(progressHorizontal.getSecondaryProgress() * 100);

3、使用自定义标题栏
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.xxx);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.my_title_bar);

4、清除标题栏内容,而区域保留
((ViewGroup) getWindow().findViewById(com.android.internal.R.id.title_container)).removeAllViews();

5、隐藏标题栏
((ViewGroup)getWindow().
findViewById(com.android.internal.R.id.title_container)).setVisibility(View.GONE);

6、显示标题栏
...setVisibility(View.VISIBLE);

其他注意事项
(1) requestWindowFeature()要在setContentView()之前调用;
(2) 设置各种Feature,是具有排它性的,一旦设置,后续不可更改为别的类型;

(3) 当使用TabHost(由ActivityGroup派生)时,各个Tab里的Activity,要么都是NO_TITLE,要么都是CUSTOM_TITLE,无法分别进行设置。

更多相关文章

  1. Android打Jar包注意事项
  2. Android点击EditText以外区域隐藏键盘Fragment同样适用
  3. Android积木之 点击空白区域隐藏小键盘
  4. Android 相机拓展库,能够实时采集并且识别相机内物体边框是否吻合
  5. Android 使用HTTPClient调用Web请求(查询手机号码区域)
  6. Android 4.0 横竖屏切换注意事项
  7. Android相机开发中遇到的坑(注意事项)
  8. Android GLSurfaceView在屏幕旋转后绘图区域异常的解决办法
  9. android 华为Mate 10 spinner 点击区域bug

随机推荐

  1. 瘦肉精卷土重来,RPA为食品安全保驾护航
  2. web前端兼容性面试题汇总!
  3. 2017腾讯云峰会观后感
  4. 零基础入门 实战mpvue2.0多端小程序框架
  5. Vue 实战商业级读书Web APP 全面提升技能
  6. Linux 三剑客 Awk、Sed、Grep 命令详解
  7. web前端编程语言有哪些?
  8. python基本语法二
  9. 浅谈MSDP
  10. 混合开发入门 Vue结合Android/iOS开发仿