在Xamarin Forms中从右侧拉出MasterPage

时间:2017-03-10 15:57:31

标签: xaml xamarin xamarin.forms

我想问一下是否有可能在xamarin.forms(最好是XAML)中使主页面显示在右侧(与其默认行为相反),如果可能的话,你会告诉我吗?如何?

1 个答案:

答案 0 :(得分:0)

默认情况下不可能。 您可以尝试Right Master Detail Page

public RightSideMasterPage ()
{
    InitializeComponent ();
    // You must set IsFullScreen in this case, 
    // otherwise you need to set HeightRequest, 
    // just like the QuickInnerMenu sample
    this.IsFullScreen = true;
    // You must set WidthRequest in this case
    this.WidthRequest = 250;
    this.MenuOrientations = MenuOrientation.RightToLeft;

    // You must set BackgroundColor, 
    // and you cannot put another layout with background color cover the whole View
    // otherwise, it cannot be dragged on Android
    this.BackgroundColor = Color.White;

    // This is shadow view color, you can set a transparent color
    this.BackgroundViewColor = Color.FromHex ("#CE766C");
}