Android App 隐藏标题栏+状态栏+导航栏
1. 隐藏当前Activity标题栏
在当前Activity中调用:this.requestWindowFeature(Window.FEATURE_NO_TITLE);
2. 隐藏当前Activity状态栏(Status Bar)
2.1 Android 4.0 and Lower
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// If the Android version is lower than Jellybean, use this call to hide
// the status bar.
if (Build.VERSION.SDK_INT < 16) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
setContentView(R.layout.activity_main);
}
...
}
2.2 Android 4.1 and Higher
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
ActionBar actionBar = getActionBar();
actionBar.hide();
3. 隐藏当前Activity界面的导航栏(NavigationBar)
在Android4.0及以后版本号中。可通过下面方法隐藏NavigationBar
View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
4. 隐藏全部Activity界面的标题栏
改动AndroidManifest.xml
在application 标签中加入a
android:theme="@android:style/Theme.NoTitleBar"
5. 隐藏全部Activity界面的TitleBar 和StatusBar
改动AndroidManifest.xml
在application 标签中加入
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
http://developer.android.com/training/system-ui/status.html#40
Android App 隐藏标题栏+状态栏+导航栏的更多相关文章
- Android中隐藏顶部状态栏的那些坑——Android开发之路3
Android中隐藏顶部状态栏的那些坑 先看看常规的隐藏状态栏的方法: 方法一: @Override protected void onCreate(Bundle savedInstanceState ...
- 移动端webapp如何隐藏浏览器的导航栏
webapp如何隐藏浏览器的导航栏 在webapp开发中,手机浏览器的导航栏会让我们的页面看起来很怪异,这个时候我们就需要将导航栏给隐藏起来,隐藏的方法十分简单,只需要在head头中加入以下几行代码就 ...
- 获取不同机型微信小程序状态栏+导航栏高度
获取不同机型微信小程序状态栏+导航栏高度 一. 前言 很多时候我们开发微信小程序,都需要先知道状态栏和导航栏的高度,才能去做其他功能 二. 获取微信小程序状态栏高度 用wx.getSystemInfo ...
- 炫酷:一句代码实现标题栏、导航栏滑动隐藏。ByeBurger库的使用和实现
本文已授权微信公众号:鸿洋(hongyangAndroid)原创首发. 其实上周五的时候已经发过一篇文章.基本实现了底部导航栏隐藏的效果.但是使用起来可能不是很实用.因为之前我实现的方式是继承了系统的 ...
- Android中隐藏标题栏和状态栏
http://www.cnblogs.com/zhuguangwei/archive/2011/01/18/1938276.html 一.隐藏标题栏 //隐藏标题栏 this.requestWindo ...
- Android4.2.2 动态显示隐藏屏幕底部的导航栏(对系统源码进行修改)
需求如题. 在Android4.2.2中,导航栏(也就是屏幕底部的三个按钮,home,back,recentapp)是系统应用SystemUi.apk的一部分,简言之,我们的需求就是让我们的app来控 ...
- Android App 沉浸式状态栏解决方案
伴随着 Android 5.0 发布的 Material Design,让 Android 应用告别了以前的工程师审美,迎来了全新的界面,灵动的交互,也让越来越多的 App 开始遵从 material ...
- android: 获取屏幕高度和虚拟导航栏高度的几种方法
package com.yongdaimi.android.androidapitest; import android.app.Activity; import android.content.Co ...
- [Android]--RadioGroup+RadioButton实现底部导航栏
RadioGroup+RadioButton组合方式打造简单实用的底部导航栏 代码块: <?xml version="1.0" encoding="utf-8&qu ...
随机推荐
- java获取时间格式
文章来源:https://www.cnblogs.com/hello-tl/p/9263602.html package com.util; import java.text.SimpleDateFo ...
- restful规范和drf模块
restfu1规范 它是一个规范,面向资源架构 10条规范: 1.api与用户的通信协议,总是使用https协议 api网上提供的接口 2.域名: 尽量将api部署在专用域名(会存在跨域问题) API ...
- python基础——16(re模块,内存管理)
一.内存管理 1.垃圾回收机制 不能被程序访问到的数据,就称之为垃圾. 1.1.引用计数 引用计数是用来记录值的内存地址被记录的次数的. 每一次对值地址的引用都使该值的引用计数+1:每一次对值地址的释 ...
- Linux之crontab定时任务
****crontab简介**** 简而言之呢,crontab就是一个自定义定时器. ****crontab配置文件**** 其一:/var/spool/cron/ 该目录下存放的是每个用户(包括ro ...
- Python3常用模块的安装
1.mysql驱动:mysql-connector-python 1.安装 $ pip3 install mysql-connector-python --allow-external mysql-c ...
- .NET重构(七):VS报表的制作
导读:机房做到最后阶段,就是报表的制作了.想到第一次,是借助外部控件进行实现的,这次采用VS进行编写,在这个软件中,有自带的报表编辑工具,更加的方便和简洁,现在就对这一块的学习,进行总结. 一.报表制 ...
- vue 组件高级用法实例详解
一.递归组件 组件在它的模板内可以递归地调用自己, 只要给组件设置name 的选项就可以了. 示例如下: <div id="app19"> <my-compone ...
- spring 找不到applicationContext.xml解决方法
初学Spring在用Resource rs=new ClassPathResource("applicationContext.xml");时老是遇到这个错误.后来发现用Appli ...
- spring mvc 单元测试示例
import java.awt.print.Printable; import java.io.IOException; import javax.servlet.http.HttpServletRe ...
- codevs——2370 小机房的树
2370 小机房的树 时间限制: 1 s 空间限制: 256000 KB 题目等级 : 钻石 Diamond 题解 题目描述 Description 小机房有棵焕狗种的树,树上有N个 ...