Skip to content

修复横屏挖孔区域显示黑边 - #8

Merged
wuyu8512 merged 1 commit into
mainfrom
fix/android-landscape-cutout
Aug 25, 2026
Merged

修复横屏挖孔区域显示黑边#8
wuyu8512 merged 1 commit into
mainfrom
fix/android-landscape-cutout

Conversation

@wuyu8512

Copy link
Copy Markdown
Contributor

问题

Android 刘海屏或挖孔屏设备横屏时,窗口默认不进入显示缺口区域,导致 SafeArea 外侧显示系统黑边。

修复

  • 为日间和夜间 NormalTheme 设置 android:windowLayoutInDisplayCutoutMode=shortEdges
  • 保留 Flutter 的全局 edge-to-edge 布局,由 MediaQuery / SafeArea 继续负责避让摄像头区域
  • 使用 tools:targetApi="o_mr1" 标注该 Android 8.1+ 窗口属性

验证

  • flutter build apk --debug

Closes #5

@wuyu8512
wuyu8512 merged commit 073d6aa into main Aug 25, 2026
2 checks passed
@wuyu8512
wuyu8512 deleted the fix/android-landscape-cutout branch August 25, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

横屏时safearea是黑色的

1 participant