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.

WebView nested in StackLayout not displaying correctly in iOS/Mac Catalyst

See original GitHub issue

Description

WebView is not displaying on iOS device, it works fine on android and windows devices. I have added steps to reproduce

Steps to Reproduce

Create a page with this code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MltDimParisPhoneApp.EnglishPage" 
             NavigationPage.HasNavigationBar="False" NavigationPage.HasBackButton="False"
             Shell.NavBarIsVisible="False">
    <StackLayout VerticalOptions="StartAndExpand" BackgroundColor="DarkSlateGrey">
        <StackLayout Spacing="5" Orientation="Horizontal" Padding="8">
            <Button Text="Go Back" Clicked="PreviousLabelGR_Clicked" TextColor="DarkSlateGray"/>
            <Button Text="Select Language" Clicked="ChangeLangBtn_Clicked" x:Name="ChangeLangBtn" TextColor="DarkSlateGray"/>
        </StackLayout>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="100*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100*"/>
            </Grid.ColumnDefinitions>

            <WebView Grid.Row="0" Grid.Column="0" 
                     Source="https://example.com" 
                     VerticalOptions="StartAndExpand" 
                     HorizontalOptions="Fill" 
                     x:Name="WebView"/>
        </Grid>
    </StackLayout>
</ContentPage>

Link to public reproduction project repository

none

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16

Did you find any workaround?

No response

Relevant log output

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
drasticactionscommented, Oct 20, 2022

drasticactions

So then what would be my solutions to this issue? Thanks

It’s most likely still a MAUI bug regarding how the WebView is laid out, most likely with StackLayout.

If you replace the outer StackLayout with a Grid, it should work

image
0reactions
msftbot[bot]commented, Oct 20, 2022

We’ve moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin Forms - Webview is not showing up within my ...
Change the Vertical Options of the StackLayout (which holds the WebView) from CenterAndExpand to FillAndExpand and the WebView itself.
Read more >
[Code]-webview inside listview on xamarin.forms
It's generally just a bad idea to even try to nest a web view inside a list view. Even a nested scroll views...
Read more >
David Ortinau, Author at .NET Blog
UI controls like Border, WebView, and Entry received updates to their behavior, ... NET 8 release for the new versions of iOS, iPadOS,...
Read more >
What's New in .NET MAUI? (Features & Performance)
NET MAUI's newest features promise to make cross-platform app development even more accessible and efficient. Check them out now.
Read more >
Dotnet Maui Net Maui 7.0 | PDF | Hyper V | Xamarin
NET MAUI use Mac Catalyst, a solution from Apple that ... MAUI) app on Mac Catalyst using . ... Conversely, when a WebView...
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