在我的应用程序(适用于 iOS,使用 iPhone 14 Plus 进行测试)中,我有一个页面想要显示为模式。目前的问题是,当我将其显示为模式时,内容不会填充整个页面。这在屏幕顶部不是问题。然而,底部也有空间,我不知何故无法填充内容。我在这里做错了什么吗?
在页面的xaml中我只定义了背景和边框元素。正如这里所见:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Background="Red">
<Border Background="{StaticResource DefaultBackgroundColor}" StrokeThickness="0"/>
</Contentpage>
Border
的行为只有在有子元素时才定义。要填写父项,请尝试:
<Border Background="{StaticResource DefaultBackgroundColor}" StrokeThickness="0">
<Grid RowDefinitions="*">
</Grid>
</Border>
带有“*”行的网格占用所有可用空间。