MAUI .NET 8 - Xamarin Migrated project

Aneetha 45 Reputation points
2024-07-19T05:31:32.3766667+00:00

I have created a new MAUI .NET 8 project and migrated the Xamarin forms project code.

In my project, I used RelativeLayout for UI design on all the pages, now this RelativeLayout is outdated in MAUI.

I used the Compatability namespace to use RelativeLayout in my MAUI project. However, the RelativeLayout is not working properly in MAUI. the position of elements in RelativeLayout working weirdly.

My question is,

RelativeLayout will work properly in MAUI or not?

Do I need to strictly not use RelativeLayout in MAUI? If yes what is the recommended layout in MAUI which similar/alternative to RelativeLayout?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,207 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 71,936 Reputation points Microsoft Vendor
    2024-07-19T07:40:06.9066667+00:00

    Hello,

    Do I need to strictly not use RelativeLayout in MAUI? If yes what is the recommended layout in MAUI which similar/alternative to RelativeLayout?

    You can use Use Grid instead, from this document:Layout behavior changes from Xamarin.Forms

    Best Regards,

    Leon Lu


    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.