• Android隐藏标题栏,全屏显示


    Android 1.5测试通过

    只需在以下代码中的,setCurrentView();之前调用即可

    http://hi.baidu.com/wishwingliao/blog/item/38feb71c994ae98587d6b6e0.html

    /**
         * 标题栏隐藏,在Activity.setCurrentView();之前调用此方法
         */
        private void HideTitle()
        {
            requestWindowFeature( Window.FEATURE_NO_TITLE );
        }

        /**
         * 状态栏隐藏(全屏),在Activity.setCurrentView();之前调用此方法
         */
        private void HideStatusBar()
        {
            //隐藏标题
            requestWindowFeature( Window.FEATURE_NO_TITLE );
            //定义全屏参数
            int flag = WindowManager.LayoutParams.FLAG_FULLSCREEN;
            //获得窗口对象
            Window myWindow = this.getWindow();
            //设置Flag标识
            myWindow.setFlags( flag, flag );
        }

    ============================================

        android全屏显示

        在Activity里边使用:

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

    ============================================

     还有一种是修改AndroidManifest.xml 。

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

    无标题栏和状态栏-----application 标签中添加android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

    正常情况下:


    隐藏标题栏:


    全屏显示:


  • 相关阅读:
    leetcode--Longest Valid Parentheses
    leetcode--Sum Root to Leaf Numbers
    leetcode--Max Points on a Line
    leetcode--Substring with Concatenation of All Words
    leetcode--Restore IP Addresses
    leetcode--4Sum
    leetcode--3Sum
    leetcode--Simplify Path
    leetcode--Text Justification
    leetcode--Multiply Strings
  • 原文地址:https://www.cnblogs.com/zziss/p/2347123.html
Copyright © 2020-2023  润新知