这是我编写的用于创建“主详细信息”页面的代码:
请检查一下
<?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="Default">
<MasterDetailPage.Master>
<ContentPage Title="MenuPage" Icon="menuIcon.png" Padding="0,50,0,0">
<ContentPage.Content>
<StackLayout VerticalOptions="Start">
<Button Text="Home" />
<Button Text="Login" />
<Button Text="Logout" />
<Button Text="Exit" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
<local:Login/>
</MasterDetailPage.Detail>
</MasterDetailPage>
答案 0 :(得分:1)
从Xamarin 4.0开始,使用MasterDetailPage
可以更轻松地实现此Shell
功能。 David制作了一段视频,演示如何使用Shell
。他的Youtube video
答案 1 :(得分:0)
我已经在一个普通项目中检查了您的代码,到目前为止没有错误,需要进一步检查“详细信息”页面代码。我的意思是
的内容 <MasterDetailPage.Detail>
<local:Login/>
</MasterDetailPage.Detail>