Xaml 导航页面包装导致状态栏中出现错误
当我尝试将Xaml 导航页面包装导致状态栏中出现错误,xaml,xamarin.forms,navigation,Xaml,Xamarin.forms,Navigation,当我尝试将导航添加到我的CropsListPage <?xml version="1.0" encoding="utf-8" ?> <TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-Balloney.Views" x:Class=
导航
添加到我的CropsListPage
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-Balloney.Views"
x:Class="Balloney.Views.MainPage">
<NavigationPage Icon="carrot.png">
<x:Arguments>
<local:CropListPage/>
</x:Arguments>
</NavigationPage>
<ContentPage Icon="search.png"></ContentPage>
</TabbedPage>
以及CropList
xaml
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Balloney.Views.CropListPage">
<ListView ItemsSource="{Binding CropsList}" ItemTapped="OnCropTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<Image Source="{Binding ImageUrl}" VerticalOptions="Fill" WidthRequest="50"/>
<StackLayout HorizontalOptions="StartAndExpand">
<Label Text="{Binding Specie.Name}"/>
<Label Text="{Binding HarvestDate}" FontSize="Micro" TextColor="Black"/>
</StackLayout>
<Label Text="{Binding Location}" FontSize="Micro" TextColor="Chocolate" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
编辑:错误似乎与我在CropListPage
内的列表视图有关,因为切换到搜索图标
页面时没有错误
可能是因为您在导航页面中包装了作物列表页面,因此当选择该页面时,您将获得上面的导航栏空间
如果选择第二个选项卡,空间是否消失
如果向裁剪页面添加标题,它是否会出现在大的绿色空间中
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Chronocrops.Views"
x:Class="Chronocrops.Views.MainPage">
<NavigationPage Icon="carrot.png" Title="Crop List">
<x:Arguments>
<local:CropListPage/>
</x:Arguments>
</NavigationPage>
<ContentPage Icon="search.png"></ContentPage>
</TabbedPage>
第一张图像中的额外空间是默认情况下显示导航栏的导航页面的结果,导航栏可以隐藏
一个如何隐藏它的示例。我认为导航页面应该包装选项卡式页面,而不是选项卡式页面中的内容页面。@SteveChadbourne如果我这样做的话,结果也是一样的。但我遵循了文档,我做得很好。它可以包装导航页面also@SteveChadbourne检查一下,没错。事实上,它明确地说不要在导航页面中包装点击的页面!是的,你是对的,在搜索图标页面
它保持正常。否,标题仍保留在内部。我会上传一张照片。你知道为什么会发生这种情况仅仅是因为我在页面中有一个ListView
?
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Chronocrops.Views"
x:Class="Chronocrops.Views.MainPage">
<NavigationPage Icon="carrot.png" Title="Crop List">
<x:Arguments>
<local:CropListPage/>
</x:Arguments>
</NavigationPage>
<ContentPage Icon="search.png"></ContentPage>
</TabbedPage>