1

I'm developing a new cross-platform application with Xamarin 4.0 and I want change layouts to right to left direction.

I want shell items and flyout menu in right of screen. I tried this code in Shell tag. But it didn't work.

FlowDirection = "RightToLeft"

What should I do?

Thanks.

4

2 回答 2

2

不幸的是,这应该是Shell Flyout的极限。

FlowDirection:只能修改子视图内容的方向,不能修改它的父布局。

在官方示例Xamarin.Forms - Xaminals中测试后,设置FlowDirection = "RightToLeft"无法将 Flyout 从屏幕左侧更改为屏幕右侧。

在此处输入图像描述

注意:如果有其他解决父布局方向的解决方案,将在此处更新。

于 2019-08-15T05:23:43.977 回答
0

在 OnCreate 方法内的主要活动中:让它看起来像那样

    protected override void OnCreate(Bundle savedInstanceState)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;
        base.OnCreate(savedInstanceState);
        Xamarin.Essentials.Platform.Init(this, savedInstanceState);
        global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

        Window.DecorView.LayoutDirection = LayoutDirection.Rtl;

        LoadApplication(new App());
    }
于 2021-02-01T20:58:27.347 回答