【问题标题】:xamarin UWP masterdetailpage width How to setxamarin UWP masterdetailpage width 如何设置
【发布时间】:2017-11-07 07:39:58
【问题描述】:

我有一个带有 xamairn 表单的程序,一个客户项目是 UWP。
MasterDetailPageMaster控件在Android和IOS平台下外观正常,但在UWP平台下显得不友好。我知道我可以使用 Grid 来替换。但是,我不确定Masterdetailpage 中是否存在一些问题,或者我错过了一些使用它的关键过程。

在UWP是这样的:

【问题讨论】:

    标签: xamarin xamarin.forms xamarin.ios xamarin.android xamarin.uwp


    【解决方案1】:

    但它在 UWP 平台中看起来不友好。我知道我可以使用 Grid 来替换。但是,我不确定 Masterdetailpage 中是否存在一些问题,或者我错过了一些使用它的关键程序。

    如果您没有为MasterDetailPage 设置MasterBehavior。正如您所提到的,Master 将默认打开。请根据以下代码设置MasterBehavior。你会得到正常的外观。

    <MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" 
                      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
                      xmlns:local="clr-namespace:MasterDetailPageNavigation;assembly=MasterDetailPageNavigation"
                      x:Class="MasterDetailPageNavigation.MainPage" MasterBehavior="SplitOnPortrait">
    </MasterDetailPage>
    

    【讨论】:

    • 完美,我刚刚为 android 添加了条件语句 MasterBehavior="Popover" 为 UWP 添加了 SplitOnPortrait
    猜你喜欢
    • 2018-01-20
    • 2017-03-16
    • 2019-08-11
    • 2019-03-17
    • 2017-12-02
    • 2017-11-06
    • 1970-01-01
    • 2018-03-01
    • 1970-01-01
    相关资源
    最近更新 更多