Xamarin Shell Flayout Menu on Right Hand Side?

Chirag Pokiya 96 Reputation points
2021-10-06T13:24:21.707+00:00

Hi World!

I want to display AppShell flyout Menu on the Right-hand side How can I achieve that?
138221-screenshot-2021-10-06-at-64913-pm.png

Thanks

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 72,171 Reputation points Microsoft Vendor
    2021-10-07T01:56:54.43+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    You can add FlowDirection="RightToLeft" in the <Shell> tag like following code.

       <Shell xmlns="http://xamarin.com/schemas/2014/forms"   
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"  
              xmlns:local="clr-namespace:App143.Views"  
              Title="App143"  
           
             FlowDirection="RightToLeft"  
         
              x:Class="App143.AppShell">  
    

    For Android, please open the MainActivity.cs. Then add Window.DecorView.LayoutDirection = LayoutDirection.Rtl; in the OnCreate method.

       protected override void OnCreate(Bundle savedInstanceState)  
               {  
                   base.OnCreate(savedInstanceState);  
         
                   Xamarin.Essentials.Platform.Init(this, savedInstanceState);  
                   global::Xamarin.Forms.Forms.Init(this, savedInstanceState);  
         
       //add here  
                   Window.DecorView.LayoutDirection = LayoutDirection.Rtl;  
         
                   LoadApplication(new App());  
               }  
    

    Then open the AndroidManifest.xml add android:supportsRtl="true" to <application> tag like following code.

       <application android:label="App143.Android" android:theme="@style/MainTheme"  android:supportsRtl="true"></application>  
    

    Here is running screenshot.

    138372-image.png 138373-image.png

    Best Regards,

    Leon Lu


    If the response is helpful, please click "Accept Answer" and upvote it.

    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.