【问题标题】:Xamarin.Forms MasterDetailPage override IsPresentXamarin.Forms MasterDetailPage 覆盖 IsPresent
【发布时间】:2017-04-06 10:15:47
【问题描述】:

我尝试将我的 MasterDetailPage 设置为始终在平板电脑布局上显示 MasterPage:

    public MainPage()
    {
        InitializeComponent();
        if (Device.Idiom == TargetIdiom.Phone)
        {
            this.MasterBehavior = MasterBehavior.Popover;
        }
        else
        {
            this.MasterBehavior = MasterBehavior.Split;
        }
    }

但是,汉堡图标仍然显示,点击它时我收到错误消息Can't change IsPresented when setting Split。如何覆盖 IsPresented 属性?我试图将一个方法绑定到IsPresentedChanged,但只有在IsPresented 值更改之后才会触发事件,而不是之前 - 因此我仍然遇到异常。

【问题讨论】:

    标签: xamarin xamarin.forms


    【解决方案1】:

    我无法发表评论,因此不得不将其作为答案。

    在将行为设置为拆分之前,您可以设置 IsPresented = true 吗?

    因为这应该使母版页可见,而不是汉堡图标。

    【讨论】:

    • 不幸的是,这不起作用。汉堡图标仍然显示。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-28
    • 2017-07-17
    • 1970-01-01
    • 2018-07-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-05
    相关资源
    最近更新 更多