【发布时间】:2017-08-18 08:38:04
【问题描述】:
我在 Toolbar 上使用了 红色图标,但它仍然是默认的蓝色。我怎样才能将其更改为红色。
因为最初图标的颜色最初是红色。
请问我该如何解决这个问题。
图片如下:
这是 Xaml 代码:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Icon ="nav_icon.png" Title="Ea "
x:Class="EAMobileDirectory.MasterPage">
<StackLayout>
<Image Source="featured_newline_1.png" Margin="0,1,0,0"/>
<ListView x:Name="listView" Margin="0,10,0,0" VerticalOptions="FillAndExpand" SeparatorVisibility="None">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell Text="{Binding Title}" ImageSource="{Binding IconSource}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
我还根据@Steven 更改了我的 AppDelegate.cs 文件,下面是我更改的代码:
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
UIToolbar.Appearance.TintColor = UIColor.Red;
UIToolbar.Appearance.BarTintColor = UIColor.Green;
return base.FinishedLaunching(app, options);
}
}
【问题讨论】:
标签: c# xaml xamarin.forms