You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MAUI布局异常:垂直StackLayout元素定位不符预期求助

MAUI布局与字体异常问题排查请求

我拥有多年Xamarin开发经验,以下MAUI XAML代码按逻辑应正常运行,但实际效果存在两个问题:

  • iOS端垂直StackLayout内的元素定位不符合预期(底部图片莫名靠下),尝试改用Grid仍未解决;
  • Android端布局正常,但存在字体加载异常问题。

相关XAML代码

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Skillbased.Pages.LogIn.CreateAccount.Page_Tutorial"
             Title="Page_Tutorial">
    <ScrollView>
        <StackLayout>
            <Grid Margin="0,30,0,0">        
                <Image Source="img_headerbar"/>
                 <Label VerticalOptions="Center"
                       FontFamily="BebasNeue"
                       FontSize="30"
                       HorizontalOptions="Center"
                       Text="WARUM SKILLBASED?"/>
            </Grid>
            <Image VerticalOptions="Start" Source="img_bike"/>
        </StackLayout>
    </ScrollView>
</ContentPage>

运行效果截图

iOS运行效果

iOS运行截图

Android运行效果

Android运行截图

内容的提问来源于stack exchange,提问作者inno

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 12:25:25