question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flickering WebView

See original GitHub issue

Description

I have been using the webview for a while, it was working perfectly fine, but after a while it started flickering. I expected to disappear since it appeared out of nowhere and the site I was trying to load was under construction, but that doesn’t seem to be the case.

Steps to Reproduce

  1. Add a webview
  2. Add a website that doesn’t end with “.nl” (that worked perfectly fine for me, but mabye that’s the case for servers that are in your country)
  3. after a while it starts acting weird (for me it took one or two months before it started flickering, so it isn’t really easy to reproduce)

Version with bug

7.0 (current)

Last version that worked well

The last version that got released in September

Affected platforms

Android

Affected platform versions

idk

Did you find any workaround?

I haven’t found a workaround, I noticed that this bug isn’t happening to all sites though

Relevant log output

there is no output, just a flickering webview

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
vhugogarciacommented, Dec 15, 2022

Thanks @Mielesgames for sharing the small sample reproducing the issue.

After some local testing I found out that the flickering occurs when there is not set HeightRequest and WidthRequest. The following code shows some local tests I did to reproduce the issue:

<!-- Fixed Height & Width :: WORKS OK (No Flickering) -->
        <WebView x:Name="WebsiteViewFixedSize"
                 HeightRequest="300"
                 WidthRequest="350"/>

       <!-- Fixed Width Only :: FAILED -->
        <WebView x:Name="WebsiteViewPartialSize"
                 VerticalOptions="FillAndExpand"
                 WidthRequest="350"/>

         <!-- Dynamic Size :: FAILED -->
        <WebView x:Name="WebsiteViewFullSize"
                 VerticalOptions="FillAndExpand"
                 HorizontalOptions="FillAndExpand"/>

What makes this bug interesting if that only fails with the following URL: https://www.r-go-tools.com , others URLs load just fine I even tried to load random websites and they do not show the flickering issue.

I’m not sure if this is a bug in MAUI or the website from that particular domain. If this is a bug maybe @jsuarezruiz can provide more insights about it.

@Mielesgames as a temporary workaround I recommend you to set a fixed height and width to the WebView. You can use the MAUI Essentials in the constructor of the page to get the Display dimensions for height and width and then set those values to the webview control.

Read more comments on GitHub >

github_iconTop Results From Across the Web

web view content flickering in android?
I use this code and add a 2 seconds delay to show the webview after webview.loadUrl(). And flicker is gone. Thanks! – herbertD....
Read more >
Maui WebView flickering - Microsoft Q&A
My .NET MAUI WebView has been flickering for the last few months, and I have no idea why since it worked perfectly fine...
Read more >
Weird content flickering on certain pages/apps : r/lgv20
Hello! For months now, when I view emails in the gmail app, or certain websites, or watch embedded videos...not the screen but the...
Read more >
Android : WebView "flashing" with white background if ...
Android : WebView " flashing " with white background if hardware acceleration is enabled (Android 3.0+) [ Beautify Your Computer ...
Read more >
WebView detachment on starting animation causes flicker on ...
As far as I understand, the issue is that the WebView is detached from the window in the beginning of the animation, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found