简介

在使用kotlin开发Android,隐藏action bar 和status bar的方法,并非网上流传的千篇一律的废弃的方法。

代码

class XXXActivity : AppCompatActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.XXX)initUI()}private fun initUI() {hideStatusBar()hideActionBar()}private fun hideStatusBar() {WindowCompat.setDecorFitsSystemWindows(window, false)val windowInsetsCompat = WindowInsetsControllerCompat(window, window.decorView)windowInsetsCompat.hide(WindowInsetsCompat.Type.statusBars())}private fun hideActionBar() {val supportActionBar = supportActionBarsupportActionBar?.hide()}
}

Android隐藏action bar 和status bar的新方法相关推荐

  1. Customizing Navigation Bar and Status Bar in iOS 7

    RZMars个人Blog地址: http://www.rzmars.com (转载于simon ng的教程) Like many of you, I have been very busy upgra ...

  2. this code must be changed as there‘s no longer a status bar or status bar window.

    ModalName: 文件日志, ErrorLevel: Error, Function: UncaughtExceptionHandler, Line: 227, Format: <- 202 ...

  3. Android Intent Action 大全

    1.Intent的用法: (1)Action跳转 1. 使用Action跳转,当程序AndroidManifest.xml中某一个 Activity的IntentFilter定义了包含Action,如 ...

  4. android intent action 介绍大全

    一些常用的Intent: Uri Action 功能 备注 geo:latitude,longitude Intent.ACTION_VIEW 打开地图应用程序并显示指定的经纬度 geo:0,0?q= ...

  5. iOS7下隐藏status bar的详细研究

    info.plist文件中,View controller-based status bar appearance项设为YES,则View controller对status bar的设置优先级高于a ...

  6. Android Status Bar

    Android Status Bar被划分为左右两边,他的view的layout在xml中有定义.右边的图标部分是存放系统服务图标,左边是应用的一些图标.如果你想改变这些图标,可以修改StatusBa ...

  7. iOS 隐藏status bar(状态栏/电池条)的详细研究

    今天隐藏做项目,横屏时隐藏电池条发现隐藏失败,查了半天资料,总结如下: 若info.plist文件中,View controller-based status bar appearance项设为YES ...

  8. Status bar —— 设置状态栏的显示、隐藏、背景颜色、文字颜色

    一.设置状态栏显示和隐藏 1.通过 Info.plist 文件增加字段,控制状态栏全局显示和隐藏 在 Info.plist 文件中增加字段 Status bar is initially hidden ...

  9. Runtime 隐藏Status Bar背景

    2019独角兽企业重金招聘Python工程师标准>>> 这次的主题的 Runtime ,对于很多人来说,习惯了面向对象的编程语言之后再接触 C 语言一开始是拒绝的.但是当你真的用起来 ...

最新文章

  1. Cassandra使用 —— 一个气象站的例子
  2. 【Linux 内核】进程管理 task_struct 结构体 ⑤ ( files 字段 | nsproxy 字段 | 信号处理相关字段 | 信号量和共享内存相关字段 )
  3. no Bloomberg, wind, ceic, csmar at cambridge
  4. PHP的截取substr mb_substr
  5. 理解关于java反射中类的域及修饰符
  6. Android NDK开发篇(四):Java与原生代码通信(原生方法声明与定义与数据类型)
  7. 深度优先搜索——选数(洛谷 P1036)
  8. libpcap 库使用(二)
  9. 第 14 章 享元模式
  10. STM32库函数 断言机制 宏定义assert_param(expr)和assert_failed的使用方法
  11. delphi中的Format函数详解
  12. 用php打印出日历_php简单日历实现程序代码
  13. 如何在Microsoft Word里面插入图片作为背景?
  14. mc服务器切换模式显示英文字母,我的世界更改模式的指令是什么_MC切换模式指令方法新版...
  15. Fabric CA 用户指南
  16. 《高难度谈话》你需要知道的高效沟通技巧
  17. 数据分析实战一:教育课程案例线上平台数据分析
  18. 如何快速检索PDF文档中的关键词?
  19. 利用URL查看网页源代码
  20. android音频口通信——2FSK信号调制

热门文章

  1. 瑞盟RS-485接口电路MS3485代替MAX3485/SP3485
  2. 市场调研公司欧睿国际揭晓描绘中国城市千禧一代和Z世代的8个消费趋势
  3. 数字化校园建设规划方案
  4. 镜头光圈、画幅、视角和焦距的关系?
  5. 基于卷积神经网络和时域金字塔池化的语音情感分析
  6. python shapely——shapely.ops.linemerge(lines) 多线合并
  7. 请教Remine下LDAP的配置问题
  8. linux下查看光驱文件夹,LINUX中为什么没有DEV下的光驱设备文件
  9. 基于springboot开发的医院OA系统
  10. android img 格式文件怎么打开,img文件怎么打开(如何解析system.img)