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 @   ꧁执笔小白꧂  阅读(121)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
历史上的今天:
2021-10-31 C# Redis学习笔记(四)-Redis设置密码
2020-10-31 WPF-DevExpress_xaml常用控件
点击右上角即可分享
微信分享提示