六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 52|回复: 0

requestWindowFeature

[复制链接]

升级  15.33%

68

主题

68

主题

68

主题

举人

Rank: 3Rank: 3

积分
246
 楼主| 发表于 2013-2-7 17:12:07 | 显示全部楼层 |阅读模式
一、枚举常量

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.设置自己的Title:
  this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.main);
  getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,   
  R.layout.title);
  R.layout.title是一个XML文件
  示例:
<?xml version="1.0" encoding="utf-8"?><LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"  android:layout_width="wrap_content"  android:layout_height="wrap_content" >   <ImageView android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/icon"/>   <TextView android:id="@+id/text"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignParentLeft="true"         android:text="文本" />  </LinearLayout>

2、












参考:http://www.cnblogs.com/salam/archive/2010/11/30/1892143.html
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表