2014-09-24 27 views

回答

2

@霍多爾謝謝,沒有支持這樣的事情(至少在這個時候)。在使用列表視圖時的一個解決方法是創建多個帶有LTR/RTL方向的列表項模板,並根據當前UI文化使用它們。

其他控件的另一個解決方法是爲每個控件類型實現一個渲染器,並根據UI文化更改其Horizo​​ntalOptions或XAlignment。

+0

您好,如何爲每個控件編寫一個用於rtl支持的渲染器?你能給我一個樣品嗎?這個選項可以用於android,IOS和Windows手機嗎? – 2016-08-06 20:54:40

+0

嗨,請查看本指南:https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/祝你好運 – 2016-08-06 21:19:39

-1

你的意思是導航流?

通常left => right意味着在導航堆棧中添加一個頁面,right => left意味着刪除它。

您可以在「本機」C#代碼上擴展導航控制器並製作自定義動畫。有很多方法可以做到這一點。這裏有一個例子在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); 
    } 
} 
+0

謝謝,但我的意思的佈局方向,RTL或LTR。是否可以像我們在Windows Phone SDK中那樣改變它? – 2014-09-25 09:24:35

+1

我不這麼認爲。您可以在佈局上更改的唯一方向是在垂直和水平之間。 – Hodor 2014-09-25 19:18:07

1

這是2017年和Xamarin形式不支持RTL尚未..

1

這可能是值得一提的是,Grial PR酒店UI套件產品剛剛加入RTL支持。

enter image description here

More details here

相關問題