question

ChiragPokiya-7649 avatar image
0 Votes"
ChiragPokiya-7649 asked LeonLu-MSFT edited

Xamarin Shell Flayout Menu on Right Hand Side?

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


dotnet-xamarinforms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLu-MSFT avatar image
0 Votes"
LeonLu-MSFT answered LeonLu-MSFT edited

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.



image.png (88.4 KiB)
image.png (35.5 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ChiragPokiya-7649 May I know if you have got any chance to check my answer(If the response is helpful, please click "Accept Answer" and upvote it.)? I am glad to help if you have any other questions

0 Votes 0 ·