ควบคุมการแสดง UI ของระบบ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รูปที่ 1 แถบระบบ ซึ่งรวมถึง[1] แถบสถานะและ[2] แถบนำทาง
แถบระบบคือพื้นที่หน้าจอที่ใช้แสดงการแจ้งเตือน การสื่อสาร
สถานะของอุปกรณ์ และการนำทางในอุปกรณ์ โดยปกติแล้ว แถบระบบ (ซึ่งประกอบด้วยแถบสถานะและแถบนำทาง ดังที่แสดงในรูปที่ 1) จะแสดงพร้อมกับแอปของคุณ แอปที่แสดงเนื้อหาที่สมจริง เช่น ภาพยนตร์หรือรูปภาพ สามารถลดความสว่างของไอคอนแถบระบบชั่วคราวเพื่อประสบการณ์การใช้งานที่ไม่รบกวน หรือซ่อนแถบชั่วคราวเพื่อประสบการณ์การใช้งานที่สมจริงอย่างเต็มที่
หากคุ้นเคยกับคำแนะนำด้านการออกแบบ Android คุณจะทราบถึงความสำคัญของการออกแบบแอปให้เป็นไปตามหลักเกณฑ์และรูปแบบการใช้งาน UI ของ Android มาตรฐาน
คุณควรพิจารณาความต้องการและความคาดหวังของผู้ใช้
อย่างรอบคอบก่อนที่จะแก้ไขแถบระบบ เนื่องจากแถบระบบเป็นวิธีมาตรฐานที่ผู้ใช้ใช้
ในการไปยังส่วนต่างๆ ของอุปกรณ์และดูสถานะของอุปกรณ์
คลาสนี้อธิบายวิธีหรี่หรือซ่อนแถบระบบใน Android เวอร์ชันต่างๆ
เพื่อสร้างประสบการณ์การใช้งานที่สมจริง ในขณะที่ยังคงให้เข้าถึงแถบระบบได้ง่าย
บทเรียน
-
การหรี่แสงแถบระบบ
-
ดูวิธีหรี่แถบสถานะและแถบนำทาง (เลิกใช้งานแล้ว)
-
ซ่อนแถบสถานะ
-
ดูวิธีซ่อนแถบสถานะใน Android เวอร์ชันต่างๆ
-
ซ่อนแถบนำทาง
-
ดูวิธีซ่อนแถบนำทางนอกเหนือจากแถบสถานะ
-
การใช้โหมดเต็มหน้าจอแบบสมจริง
-
ดูวิธีสร้างประสบการณ์การใช้งานที่สมจริงอย่างเต็มรูปแบบในแอป
-
การตอบกลับการเปลี่ยนแปลงการแสดง UI
-
ดูวิธีลงทะเบียน Listener เพื่อรับการแจ้งเตือนเกี่ยวกับการเปลี่ยนแปลงระดับการเข้าถึง UI ของระบบ
เพื่อให้คุณปรับ UI ของแอปได้ตามนั้น
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],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."]]