zoukankan      html  css  js  c++  java
  • android StatusBar TitleBar控制

    0 StatusBar TitleBar



    1 控制StatusBar显示隐藏(display hide)

    private void updateFullscreenStatus(bUseFullscreen)
    {
    if(bUseFullscreen)
    {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    }
    else
    {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }

    m_contentView.requestLayout();
    }

    2 隐藏StatusBar TitleBar

      A:通过代码隐藏StatusBar TitleBar

    public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    // Hide the Title Bar
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.tabs1);

    // Hide the Status Bar
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);

    }


      B:通过配置隐藏TitleBar

    //Hide the Title bar through AndroidManifest.xml
    [sourcecode language="xml"]
    <activity android:name=".YourClassName"
    android:theme="@android:style/Theme.NoTitleBar"/>
    [/sourcecode]

    //Hide the Status bar through AndroidManifest.xml
    [sourcecode language="xml"]
    <activity android:name=".YourClassName"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
    [/sourcecode]


    3 控制StatusBar能否进行操作(enable disable)

    //PhoneApp位于package com.android.phone;

    final PhoneApp app = PhoneApp.getInstance();
    //disable statusbar
    app.disableStatusBar();
    //enable statusbar
    app.reenableStatusBar();



  • 相关阅读:
    SQLite增删改查(自己写SQL语句)
    Why you have so few friends?
    android数据库SQLite简单测试
    C语言 stringcpy,stringcat,stringcmp实现
    python 日期和时间
    Python continue 语句
    Python break 语句
    Python 循环语句
    Python 条件语句
    Python比较运算符
  • 原文地址:https://www.cnblogs.com/myparamita/p/2208747.html
Copyright © 2011-2022 走看看