Android标题栏各种设置
来源:互联网 发布:java api 1.7 苹果版 编辑:程序博客网 时间:2024/05/19 20:37
原博客地址http://blog.csdn.net/aomandeshangxiao/article/details/6585687
分类: Android及相关2011-07-05 14:43809人阅读评论(0)收藏举报
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,是具有排它性的,一旦设置,后续不可更改为别的类型;
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,无法分别进行设置。
- Android标题栏各种设置
- Android标题栏各种设置
- Android标题栏各种设置
- Android标题栏各种设置
- Android标题栏各种设置
- Android标题栏各种设置
- 四极管:Android标题栏各种设置
- Android标题栏的各种设置
- Android标题栏的各种设置
- Android设置标题栏图标
- android 标题栏设置
- Android 标题栏设置
- Android设置标题栏透明
- android 设置标题栏隐藏
- 为android 标题栏设置布局
- Android之定义各种样式的标题栏
- Android之定义各种样式的标题栏
- Android如何设置标题栏的高度
- SVN常用命令
- Debian 6为cairo打LCD 补丁
- ios下自定义字体
- 使用命令行 Subversion 访问项目源文件
- HDU 1254 推箱子(搜索)
- Android标题栏各种设置
- android中json转换成List<Map>
- mysql函数大全
- android中将复杂json对象进行数据转换
- 数据库系统原理复习题(一)——绪论
- DB2常用命令
- 网络地址转换相关函数
- 数据库系统原理复习题(二)——数据库完整性
- Wireshark使用方法(学习笔记一)