我创建了一个应用程序,作为我的网站的网页视图,WebView
组件在Android和Windows上显示正常,但在运行iOS 16.X的iOS(iPhone 11)设备上无法显示
<?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" TextColor="DarkSlateGray"/>
<Button Text="Select Language" 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>
WebView
不会显示,但其他控件会显示。
1条答案
按热度按时间mf98qq941#
您可以修改webview代码,如下所示: