.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
4,075 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I'm new to MAUI and have some requirements to check whether it is possible and how to do it in MAUI:
Thanks.
Hello,
In MAUI, you could use OnPlatform
to implement this requirement.
Please refer to the following official documentation and code samples:
// In this example, this BoxView is only visible on the Windows platform.
<BoxView Color="{OnPlatform Yellow, iOS=Red, Android=Green}"
WidthRequest="{OnPlatform 250, iOS=200, Android=300}"
HeightRequest="{OnPlatform 250, iOS=200, Android=300}"
IsVisible="{OnPlatform false,WinUI=true}"
HorizontalOptions="Center" />
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.