net maui how to set orientation according device?

Sami 966 Reputation points
2023-06-26T22:28:31.39+00:00

I am working on my net maui project I want to set my orientation according devices

for example windows desktop, android and ios mobiles only potrait allowed but android and ios tablets set potrait and landscape orientation dynamically..

Developer technologies | .NET | .NET MAUI
{count} vote

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,926 Reputation points Volunteer Moderator
    2023-06-26T22:38:44.81+00:00

    Maui currently does not have this feature built-in. You would use the native api to detect the screen orientation change, than update your form layout.

    https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/invoke-platform-code

    note: Maui UI is pretty primitive compared to swift-ui and jetpack compose ui. hopefully there will be a rewrite to make more competitive.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.