zoukankan      html  css  js  c++  java
  • Android中隐藏标题栏和状态栏

    http://www.cnblogs.com/zhuguangwei/archive/2011/01/18/1938276.html

    一、隐藏标题栏

        //隐藏标题栏

        this.requestWindowFeature(Window.FEATURE_NO_TITLE);

    二、隐藏状态栏

       //隐藏状态栏

       this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

       

    三、去掉所有Activity界面的标题栏

      修改AndroidManifest.xml 

      在application 标签中添加android:theme="@android:style/Theme.NoTitleBar"

    四、去掉所有Activity界面的TitleBar 和StatusBar 

      修改AndroidManifest.xml 

      在application 标签中添加 

      android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

    android动态显示和隐藏status bar(通知栏)

    1,在Activity的onCreate中设置:

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

    2,在需要显示和隐藏的时候调用:

    private void hideStatusBar() {
    WindowManager.LayoutParams attrs = getWindow().getAttributes();
    attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
    getWindow().setAttributes(attrs);
    }

    private void showStatusBar() {
    WindowManager.LayoutParams attrs = getWindow().getAttributes();
    attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
    getWindow().setAttributes(attrs);
    }

  • 相关阅读:
    MySQL的备份
    Linux下MySQL安装及配置
    MySQL的优化
    MySQL的基本操作
    python文件操作练习之文件备份
    文件操作练习之统计目录大小
    SQLite
    PyMySQL模块
    python语法练习题之九九乘法表
    类装饰器
  • 原文地址:https://www.cnblogs.com/liulipeng/p/3916735.html
Copyright © 2011-2022 走看看