package com.example.t;
import android.os.Bundle;
import android.app.Activity;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 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:标题栏右侧的图标
// 自定义标题
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
// setContentView(R.layout.activity_main);
// getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
// R.layout.title);
// 设置标题不确定进度条
// requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// setContentView(R.layout.activity_main);
// getWindow().setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS,
// R.layout.progress);
// setProgressBarIndeterminateVisibility(true);
// FEATURE_LEFT_ICON添加左边图标 FEATURE_RIGHT_ICON添加右边图标
// requestWindowFeature(Window.FEATURE_LEFT_ICON);
// setContentView(R.layout.activity_main);
// getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
// R.drawable.ic_launcher);
// 无标题
// requestWindowFeature(Window.FEATURE_NO_TITLE);
// setContentView(R.layout.activity_main);
// 全屏
// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
// WindowManager.LayoutParams.FLAG_FULLSCREEN);
// 设置为进度条
// requestWindowFeature(Window.FEATURE_PROGRESS);
// setProgressBarVisibility(true);
// setContentView(R.layout.activity_main);
// getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
// Window.PROGRESS_VISIBILITY_ON);
// setProgress(100);// 满值为10000
// setSecondaryProgress(5000);// 满值为10000
}
}
应用程序窗体显示状态操作requestWindowFeature
最新推荐文章于 2019-04-19 17:14:25 发布