MAUI-XAML不同平台做实现不同样式_OnPlatform On

使用OnPlatform->On标签的样式:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="...">
    <ContentPage.Padding>
        <OnPlatform x:TypeArguments="Thickness">
            <On Platform="iOS, Android" Value="10, 20, 20, 10" />
        </OnPlatform>
    </ContentPage.Padding>
    ...
</ContentPage>

 

posted @ 2022-10-31 23:14  ꧁执笔小白꧂  阅读(130)  评论(0)    收藏  举报