Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改Xamarin移动应用程序的工具栏颜色_Xamarin_Xamarin.forms_Xamarin.android_Visual Studio 2019 - Fatal编程技术网

更改Xamarin移动应用程序的工具栏颜色

更改Xamarin移动应用程序的工具栏颜色,xamarin,xamarin.forms,xamarin.android,visual-studio-2019,Xamarin,Xamarin.forms,Xamarin.android,Visual Studio 2019,我是xamarin.forms开发的新手,我正在使用VisualStudio 2019实现同样的目标。我正在开发一个示例shell应用程序,但无法更改工具栏的颜色(图片中为蓝色)。谁能在这个问题上帮助我 我们可以通过在shell.xaml 例如,我们将其设置为绿色 <Shell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

我是xamarin.forms开发的新手,我正在使用VisualStudio 2019实现同样的目标。我正在开发一个示例shell应用程序,但无法更改工具栏的颜色(图片中为蓝色)。谁能在这个问题上帮助我


我们可以通过在
shell.xaml

例如,我们将其设置为绿色

<Shell 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:local="clr-namespace:xxx"
   Title="xxx"
   BackgroundColor="Green"
   x:Class="xxx.AppShell">

你有没有在你的房间里试过这个颜色Navigation@Prasanth我在shellItem中没有找到这样的属性。你能帮我吗。
<Shell.Resources>
    <ResourceDictionary>
        <Color x:Key="NavigationPrimary">#2196F3</Color> //color of TabBar

        <Style x:Key="BaseStyle" TargetType="Element">
            <Setter Property="Shell.BackgroundColor" Value="{StaticResource NavigationPrimary}" />
            <Setter Property="Shell.ForegroundColor" Value="White" />
            <Setter Property="Shell.TitleColor" Value="White" />
            <Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
            <Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
            <Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
            <Setter Property="Shell.TabBarForegroundColor" Value="White"/>
            <Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF"/>
            <Setter Property="Shell.TabBarTitleColor" Value="White"/>
        </Style>
        <Style x:Key="MyBaseStyle" TargetType="Element">

            <Setter Property="Shell.ForegroundColor" Value="White" />
            <Setter Property="Shell.TitleColor" Value="White" />
            <Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
            <Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
            <Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
            <Setter Property="Shell.TabBarForegroundColor" Value="White"/>
            <Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF"/>
            <Setter Property="Shell.TabBarTitleColor" Value="White"/>
        </Style>

        <Style TargetType="ShellItem" BasedOn="{StaticResource BaseStyle}" />
        <Style TargetType="TabBar" BasedOn="{StaticResource MyBaseStyle}" />
    </ResourceDictionary>
</Shell.Resources>

<!-- Your Pages -->
<TabBar  >
    <Tab Title="xxx" Icon="xxx" >
        <ShellContent ContentTemplate="{DataTemplate xxx}" />
    </Tab>
    <Tab Title="xxx" Icon="xxx">
        <ShellContent ContentTemplate="{DataTemplate xxx}" />
    </Tab>
</TabBar>