requestWindowFeature
来源:互联网 发布:弱视网络训练软件 编辑:程序博客网 时间:2024/05/18 20:50
android开发中经常会在setContentView(R.layout.XXX); 前设置requestWindowFeature(XXXX)。
他的意思是需要软件全屏显示、自定义标题(使用按钮等控件)和其他的需求
首先介绍一个重要方法那就是requestWindowFeature(featrueId),它的功能是启用窗体的扩展特性。参数是Window类中定义的常量。
一、枚举常量
1.DEFAULT_FEATURES:系统默认状态,一般不需要指定
2.FEATURE_CONTEXT_MENU:启用ContextMenu,默认该项已启用,一般无需指定
3.FEATURE_CUSTOM_TITLE:自定义标题。当需要自定义标题时必须指定。如:标题是一个按钮时
4.FEATURE_INDETERMINATE_PROGRESS:不确定的进度
5.FEATURE_LEFT_ICON:标题栏左侧的图标
6.FEATURE_NO_TITLE:没有标题
7.FEATURE_OPTIONS_PANEL:启用“选项面板”功能,默认已启用。
8.FEATURE_PROGRESS:进度指示器功能
9.FEATURE_RIGHT_ICON:标题栏右侧的图标
二、详解
默认显示状态
1.FEATURE_CUSTOM_TITLE详解
Java代码 收藏代码
this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
这是因为没有设置Featrue
在上面代码后加:getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);
自定义标题完成,它是一个xml文件布局
- requestWindowFeature
- requestWindowFeature
- requestWindowFeature
- requestWindowFeature
- requestWindowFeature
- RequestWindowFeature
- requestWindowFeature
- requestWindowFeature
- requestWindowFeature
- requestWindowFeature
- requestWindowFeature(featrueId)
- requestWindowFeature 使用
- requestWindowFeature详解
- requestWindowFeature使用
- requestWindowFeature详解
- requestWindowFeature使用
- requestWindowFeature详解
- Android 中的 requestWindowFeature
- 触摸[2] 拖动
- gcc中-c和-o参数
- 指定栈的进栈顺序,输出所有可能的出栈顺序
- Druid 介绍及配置
- Android开发工具类
- requestWindowFeature
- Redis数据结构简介
- XCTF:练习CTF解题XMAN比赛 8-8 login
- ELK之logstash长久运行
- LintCode 5: Kth Largest Element
- PHP关于VC11,VC9,VC6以及Thread Safe和Non Thread Safe版本选择的问题
- java面向对象(一)
- Mybatis系列(六)接口式编程
- C++一个标准类的学习