HarmonyOS WebView加载url无法滚动

HarmonyOS
2024-12-17 15:13:36
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
zbw_apple

scroll 里面嵌套webView,demo参考:

// xxx.ets
import web_webview from '@ohos.web.webview'

@Entry
@Component
struct WebComponent {
  controller: web_webview.WebviewController = new web_webview.WebviewController()
  @State mode: WebLayoutMode = WebLayoutMode.FIT_CONTENT

  build() {
    Column() {
      Text("这里是头部区域")
        .width("100%")
        .height('30%')
        .backgroundColor("#f89f0f")
        .fontSize(28)
        .fontColor("#FF0F0F")
      Web({ src: $rawfile('Index.html'), controller: this.controller })
        .width('100%')
        .height(200)// .layoutMode(this.mode)
        .zoomAccess(false)
        .domStorageAccess(true)
        .overviewModeAccess(true)
        .imageAccess(true)
        .onlineImageAccess(true)
        .fileAccess(true)
        .databaseAccess(true)
      Text("这里是底部区域")
        .fontSize(28)
        .fontColor("#FF0F0F")
        .width("100%")
        .height('40%')
        .backgroundColor("#f89f0f")
    }
    .width('100%')
    .height('100%')
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
分享
微博
QQ
微信
回复
2024-12-17 16:10:25
相关问题
鸿蒙Webview加载Url,alipay无法返回
10133浏览 • 1回复 待解决
HarmonyOS webview加载url白屏
953浏览 • 1回复 待解决
HarmonyOS webview无法加载file协议路径
619浏览 • 1回复 待解决
HarmonyOS webview加载页面无法显示
1778浏览 • 1回复 待解决
WebView加载网页无法自适应
1267浏览 • 1回复 待解决
webview加载url后页面一片空白,无报错
4028浏览 • 1回复 待解决
Vue工程导出的dist, webview无法加载
953浏览 • 1回复 待解决
HarmonyOS Web 加载URL异常
1347浏览 • 1回复 待解决
HarmonyOS webView隐藏滚动
682浏览 • 1回复 待解决
HarmonyOS url 无法传+号
600浏览 • 1回复 待解决
HarmonyOS 如何拦截web加载url
744浏览 • 1回复 待解决