【发布时间】:2019-12-19 16:50:34
【问题描述】:
我有一个 xamarin 表单应用程序。 我的应用程序的头部是这样的:
我想移除或隐藏绿条(顺便说一句,它叫actionbar吗?)
我的 App.xaml 是这样的:
<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="AddaDiLeonardo.App"
NavigationPage.HasNavigationBar="False">
<Application.Resources>
<ResourceDictionary>
<!--Global Styles-->
<!--Color x:Key="NavigationPrimary">#FFFFFF</-->
<Style TargetType="NavigationPage">
<!--Setter Property="BarBackgroundColor" Value="{StaticResource NavigationPrimary}" /-->
<Setter Property="BarBackgroundColor" Value="Green"/>
<Setter Property="BarTextColor" Value="Red" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
而我的 MainPage.xaml 是这样的:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:views="clr-namespace:AddaDiLeonardo.Views"
x:Class="AddaDiLeonardo.Views.MainPage"
SelectedTabColor="Blue"
UnselectedTabColor="DarkGray"
BarBackgroundColor="White"
Title="Adda di Leonardo"
>
<TabbedPage.Children>
<!--Caricamento dinamico-->
</TabbedPage.Children>
</TabbedPage>
我也尝试过编辑 xaml 文件、cs 文件和样式,但我无法弄清楚。
如果可能的话,我希望该解决方案同时适用于 android 和 ios。
感谢您的帮助!
【问题讨论】:
标签: c# android ios xamarin xamarin.forms