Xamarin Forms content page: change flow direction from right to left?

how can I change the direction of flow on the content page of Xamarin forms from left to right to right to left? something like a Windows Phone flow direction property?

+3


source to share


4 answers


@Hodor thanks there is no support for such a thing (at least at this time). A workaround to use when browsing lists is to create multiple list item templates with LTR / RTL directions and use them according to the current UI culture.



Another workaround for other controls is to implement a renderer for each control type and change its HorizontalOptions or XAlignment to suit the culture of the user interface.

+2


source


it 2017 and Xamarin forms don't support RTL yet ..



+1


source


It might be worth mentioning that the Grial UI Kit has just added RTL support.

enter image description here

More details here

+1


source


Do you mean navigation flow?

Usually left => right means adding the page to the navigation stack, while right => left means removing.

You can extend the navigation controller in a native C # codec and create custom animations. There are many ways to do this. Here is an example in MonoTouch

public partial class ScreenController : UINavigationController
{
     private Page currentPage = null;

             private void setCurrentPage(Page p)
    {
        currentPage = p;
        //Using present View Controller: will set the current page to root.
        PresentViewController(new UINavigationController(currentPage.CreateViewController())
                            {
                                ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal,
                            }, true, null);

        //Using custom animation
        PushControllerWithTransition(this, currentPage.CreateViewController(), UIViewAnimationOptions.TransitionFlipFromLeft);
    }

    public static void PushControllerWithTransition(this UINavigationController target, UIViewController controllerToPush,
        UIViewAnimationOptions transition)
    {
        UIView.Transition(target.View, 0.75d, transition, delegate()
        {
            target.PushViewController(controllerToPush, false);
        }, null);
    }
}

      

-1


source







All Articles