HarmonyOS Next使用web组件时,可以做到弹出输入键盘时,布局可以同步上滑,而不是覆盖布局下半部分吗?

使用web组件时,如何可以做到弹出输入键盘时,布局可以同步上滑,而不是覆盖布局下半部分吗?

代码如下:

 NavDestination() {
Column() {
Web({ src: '', controller: this.controller })
.backgroundColor(Color.Transparent)
.javaScriptAccess(true)// 支持js
.domStorageAccess(true)// 开启 DOM storage API 功能
.zoomAccess(false)// 设置可以支持缩放
.fileAccess(true)//允许访问本地路径
.domStorageAccess(true)
.textZoomRatio(100)//设置页面的文本缩放百分比
.layoutMode(WebLayoutMode.FIT_CONTENT)
.mixedMode(MixedMode.All)
.onControllerAttached(() => {
let userAgent = this.controller.getUserAgent()
this.controller.setCustomUserAgent(userAgent + 'FlutterWebDowngrade ')
this.controller.loadUrl(`${FlutterWebConstant.FLUTTER_WEB_HOST}/index.html#${this.flutterInitialRoute}`)
})
.onInterceptRequest((event) => {
const requestUrl = event.request.getRequestUrl()
// 加载其他文件
return loadUrlRequest(requestUrl, this.flutterInitialRoute)
})
}.width('100%')
.height('100%')
}.hideTitleBar(true)


HarmonyOS Next
HarmonyOS
2025-03-22 23:32:41
浏览
收藏 0
回答 0
待解决
相关问题
HarmonyOS 弹出键盘web页面白屏
1016浏览 • 1回复 待解决