H5 全屏适配:Web 扩展系统安全区,消除底部白边
大厅/子游戏(BridgeGameContainer)与通用网页(GenericWebContainer)的 Web 组件加 .expandSafeArea([SYSTEM],[TOP,BOTTOM]),让 H5 铺满系统安全区(底部导航手势区), 消除底部白边,与原 Android 全屏 WebView 一致。模拟器验证:大厅满屏到底,无白边。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f839c5b413
commit
81ba09b597
@@ -212,6 +212,8 @@ export struct BridgeGameContainer {
|
|||||||
.mixedMode(MixedMode.All).cacheMode(CacheMode.None)
|
.mixedMode(MixedMode.All).cacheMode(CacheMode.None)
|
||||||
.geolocationAccess(true).zoomAccess(false)
|
.geolocationAccess(true).zoomAccess(false)
|
||||||
.width('100%').height('100%')
|
.width('100%').height('100%')
|
||||||
|
// 铺满系统安全区(消除底部导航手势区白边),与原 Android 全屏 WebView 一致
|
||||||
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
|
||||||
.visibility(this.subgameUrl !== '' ? Visibility.Hidden : Visibility.Visible)
|
.visibility(this.subgameUrl !== '' ? Visibility.Hidden : Visibility.Visible)
|
||||||
.onControllerAttached(() => this.setupLobby())
|
.onControllerAttached(() => this.setupLobby())
|
||||||
.onLoadIntercept((event: OnLoadInterceptEvent) =>
|
.onLoadIntercept((event: OnLoadInterceptEvent) =>
|
||||||
@@ -231,6 +233,7 @@ export struct BridgeGameContainer {
|
|||||||
.mixedMode(MixedMode.All).cacheMode(CacheMode.None)
|
.mixedMode(MixedMode.All).cacheMode(CacheMode.None)
|
||||||
.geolocationAccess(true).zoomAccess(false)
|
.geolocationAccess(true).zoomAccess(false)
|
||||||
.width('100%').height('100%')
|
.width('100%').height('100%')
|
||||||
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
|
||||||
.onControllerAttached(() => this.setupSubgame())
|
.onControllerAttached(() => this.setupSubgame())
|
||||||
.onLoadIntercept((event: OnLoadInterceptEvent) =>
|
.onLoadIntercept((event: OnLoadInterceptEvent) =>
|
||||||
this.slotS !== undefined ? this.slotS.onLoadIntercept(event.data.getRequestUrl()) : false)
|
this.slotS !== undefined ? this.slotS.onLoadIntercept(event.data.getRequestUrl()) : false)
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ export struct GenericWebContainer {
|
|||||||
})
|
})
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
|
// 铺满系统安全区,消除底部导航手势区白边(与大厅容器一致)
|
||||||
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
|
||||||
.onProgressChange((event: OnProgressChangeEvent) => {
|
.onProgressChange((event: OnProgressChangeEvent) => {
|
||||||
// 首次 100% → 原生直调 getWebdata('<data>')(§11.3)
|
// 首次 100% → 原生直调 getWebdata('<data>')(§11.3)
|
||||||
if (event.newProgress === 100 && !this.loaded) {
|
if (event.newProgress === 100 && !this.loaded) {
|
||||||
|
|||||||
Reference in New Issue
Block a user