@@ -109,7 +109,7 @@ export struct WebView {
109109 hasRegisterJavaScriptProxy: boolean = false;
110110 controllerAttached: boolean = false;
111111 nestedScrollFlag: boolean = false;
112- // renderMode: RenderMode = RenderMode.ASYNC_RENDER ;
112+ renderMode: RenderMode = RenderMode.SYNC_RENDER ;
113113
114114 aboutToAppear() {
115115 this.descriptor = this.ctx.descriptorRegistry.getDescriptor<WebViewViewDescriptor>(this.tag)
@@ -152,7 +152,6 @@ export struct WebView {
152152 this.html = this.source.html
153153 this.url = this.source.uri;
154154 this.nestedScrollFlag = this.descriptor.props.nestedScrollEnabled;
155- //this.renderMode = this.nestedScrollFlag ? RenderMode.SYNC_RENDER : RenderMode.ASYNC_RENDER;
156155 this.registerCommandCallback()
157156 }
158157
@@ -362,11 +361,10 @@ export struct WebView {
362361
363362 build() {
364363 //RNViewBase({ ctx: this.ctx, tag: this.tag }) {
365- //Web({ src: this.source.uri, controller: this.controller, renderMode: this.renderMode })
366364 Stack() {
367- Web({ src: this.source.uri, controller: this.controller })
368- .width('100%' )
369- .height('100%' )
365+ Web({ src: this.source.uri, controller: this.controller,renderMode: this.renderMode })
366+ .width(this.descriptor.layoutMetrics.frame.size.width )
367+ .height(this.descriptor.layoutMetrics.frame.size.height )
370368 .constraintSize({ minHeight: 1 })
371369 .backgroundColor(Color.Transparent)
372370 .javaScriptAccess(this.javaScriptEnable)
@@ -384,6 +382,9 @@ export struct WebView {
384382 scrollBackward: NestedScrollMode.SELF_ONLY
385383 } : { scrollForward: NestedScrollMode.PARENT_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST })
386384 .overScrollMode(OverScrollMode.NEVER)
385+ .onSizeChange((event)=>{
386+ Logger.info(TAG, "[RNOH] event width: " + event.width + "[RNOH] event height: " + event.height)
387+ })
387388 .onProgressChange((event) => {
388389 if (event) {
389390 this.progress = event.newProgress
0 commit comments