有什么办法可以在Xamarin中设置MasterDetailPage.Master的宽度?

时间:2019-06-20 17:59:13

标签: xaml xamarin xamarin.forms xamarin.android

是否可以在Xamarin中设置MasterDetailPage.Master的宽度?我想减小菜单抽屉的宽度。希望您可以通过以下代码帮助我:

<?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
                  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                  x:Class="DemoApp.MenuPage"
                  xmlns:local="clr-namespace:DemoApp.Views"
                  MasterBehavior="Popover"
                  NavigationPage.HasNavigationBar="False"
                  NavigationPage.HasBackButton="False">

    <MasterDetailPage.Master>
        <ContentPage Title="MenuPage">
            <ContentPage.Content>
                <StackLayout VerticalOptions="Start">
                    <Button Text="Home"/>
                    <Button Text="Login" Clicked="Login_Clicked"/>
                    <Button Text="Logout"/>
                    <Button Text="Exit"/>
                </StackLayout>    
            </ContentPage.Content>
        </ContentPage>
    </MasterDetailPage.Master>

    <MasterDetailPage.Detail>
        <NavigationPage>
            <x:Arguments>
                <local:Login/>
            </x:Arguments>
        </NavigationPage>        
    </MasterDetailPage.Detail>  

</MasterDetailPage>

1 个答案:

答案 0 :(得分:0)