dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

Android Webview`s Height is not correct at the first loading #18335

Open maonaoda opened 1 year ago

maonaoda commented 1 year ago

Description

You can see that the height of the webview has covered the main title area that should be green at the first loading. The gray and transparent part should be the actual area of webview . When I click the load url button, the display becomes normal.

https://github.com/dotnet/maui/assets/32831595/ff961e5f-17e0-45ad-be86-feb8611552ec

A B
image image

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/maonaoda/Bug18335

Version with bug

8.0.0-rc.2.9373

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

maonaoda commented 1 year ago

I updated the issue and added reproduction.

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

mattleibow commented 1 year ago

Does this happen with any other control? What happens if you swap the AbsoluteLayout with a Grid?

ghost commented 1 year ago

Hi @maonaoda. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

maonaoda commented 1 year ago

Does this happen with any other control? What happens if you swap the AbsoluteLayout with a Grid?

@mattleibow problem gets nothing change, even if i swap the AbsoluteLayout with a Grid.

    <Grid BackgroundColor="White">
        <WebView Grid.Row="0" Grid.Column="0" x:Name="WebViewInstance" 
                              Source="{Binding CustomWebViewSource.Value}"
                              BackgroundColor="Pink"
                              HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
        <StackLayout Grid.Row="0" BackgroundColor="#22000000">
            <Button Text="Load Url" Clicked="OnCounterClicked" HorizontalOptions="Center" VerticalOptions="CenterAndExpand"/>
        </StackLayout>
    </Grid>
maonaoda commented 1 year ago

As a temporary workaround, I set the webview's background color to transparent.

ninachen03 commented 2 months ago

This issue has been verified using Visual Studio 17.12.0 Preview 1.0 (8.0.80 & 8.0.3 & 8.0.rc.1.9171), can repro it. NET 7 have "CS9058 Feature 'primary constructors' is not available in C# 11.0. Please use language version 12.0 or greater" so we will temporarily skip the verification of 7. NET7 error: image