控制系统界面可见性
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
图 1. 系统栏,包括 [1] 状态栏和 [2] 导航栏。
系统栏是专用于显示通知、传达设备状态和设备导航的屏幕区域。通常,系统栏(由状态栏和导航栏组成,如图 1 所示)会与您的应用同时显示。显示沉浸式内容(如电影或图片)的应用可以暂时调暗系统栏图标以减少干扰,也可以暂时隐藏系统栏,以提供完全沉浸式体验。
如果您熟悉 Android 设计指南,就会明白在设计应用时遵循标准 Android 界面准则和使用模式非常重要。在修改系统栏之前,您应该仔细考虑用户的需求和预期,因为它们为用户提供了导航设备和查看其状态的标准方式。
本课程介绍了如何在不同版本的 Android 系统上调暗或隐藏系统栏,以打造沉浸式用户体验,同时仍然保留对系统栏的轻松访问。
课程
-
调暗系统栏
-
了解如何调暗状态栏和导航栏。(已弃用)
-
隐藏状态栏
-
了解如何在不同版本的 Android 系统上隐藏状态栏。
-
隐藏导航栏
-
了解如何隐藏导航栏以及状态栏。
-
使用沉浸式全屏模式
-
了解如何在应用中打造完全沉浸式体验。
-
响应界面可见性更改
-
了解如何注册监听器来接收系统界面可见性更改的通知,以便相应地调整应用的界面。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Control the system UI visibility\n\n**Figure 1.** System bars, including the \\[1\\] status\nbar, and \\[2\\] navigation bar.\n\nThe [system bars](https://material.io/design/platform-guidance/android-bars.html) are screen areas dedicated to the display of notifications, communication\nof device status, and device navigation. Typically the system bars (which consist of the status\nand navigation bars, as shown in figure 1) are displayed\nconcurrently with your app. Apps that display immersive content, such as movies or images,\ncan temporarily dim the system bar icons for a less distracting experience,\nor temporarily hide the bars for a fully immersive experience.\n\nIf you're familiar with the [Android Design\nGuide](/design), you know the importance of designing your apps to conform to standard Android UI\nguidelines and usage patterns. You should carefully consider your users'\nneeds and expectations before modifying the system bars, since they give users a\nstandard way of navigating a device and viewing its status. \n\nThis class describes how to dim or hide system bars across different versions of Android\nto create an immersive user experience, while still preserving easy access to the system\nbars.\n\nLessons\n-------\n\n\n**[Dimming the System Bars](/training/system-ui/dim)**\n:\n Learn how to dim the status and navigation bars. (Deprecated)\n\n\n**[Hiding the Status Bar](/training/system-ui/status)**\n:\n Learn how to hide the status bar on different versions of Android.\n\n\n**[Hiding the Navigation Bar](/training/system-ui/navigation)**\n:\n Learn how to hide the navigation bar, in addition to the status bar.\n\n\n**[Using Immersive Full-Screen Mode](/training/system-ui/immersive)**\n:\n Learn how to create a fully immersive experience in your app.\n\n\n**[Responding to UI Visibility Changes](/training/system-ui/visibility)**\n:\n Learn how to register a listener to get notified of system UI visibility changes\n so that you can adjust your app's UI accordingly."]]