C# 如何在Xamarin iOS中更改选项卡栏的颜色?
visual studio更新后,选项卡栏中选定图标的颜色将恢复为默认颜色。有人知道原因吗 这是我在更新之前用来更改颜色的代码行 uitabar.Appearance.SelectedImageTintColor=UIColor.BlackC# 如何在Xamarin iOS中更改选项卡栏的颜色?,c#,ios,visual-studio,xamarin.forms,updates,C#,Ios,Visual Studio,Xamarin.forms,Updates,visual studio更新后,选项卡栏中选定图标的颜色将恢复为默认颜色。有人知道原因吗 这是我在更新之前用来更改颜色的代码行 uitabar.Appearance.SelectedImageTintColor=UIColor.Black visual studio 8.3.11或visual studio 16.4.2中的visual studio版本为8.3.11 在Xamarin表单项目中检查后,它实际上无法在AppDelegate.cs中工作。没有找到不起作用的原因,但它在Xamari
visual studio 8.3.11或visual studio 16.4.2中的visual studio版本为8.3.11 在Xamarin表单项目中检查后,它实际上无法在
AppDelegate.cs
中工作。没有找到不起作用的原因,但它在Xamarin.iOS项目中也起作用。最后,我在Xamarin.Forms项目中找到了一个变通方法
如果是Xamarin表单应用程序,则当通过SelectedTabColor
选择选项卡时,可以修改选项卡的颜色。详情如下:
<?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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
SelectedTabColor="Black"
xmlns:views="clr-namespace:AppTab2.Views"
x:Class="AppTab2.Views.MainPage">
'...
</TabbedPage>
'...
注:Xamarin表单的测试版本是Visual studio for Mac 8.3.11或Visual studio 16.4.2中的
4.4.0.991265
:
在Xamarin表单项目中检查后,它实际上无法在AppDelegate.cs
中工作。没有找到不起作用的原因,但它在Xamarin.iOS项目中也起作用。最后,我在Xamarin.Forms项目中找到了一个变通方法
如果是Xamarin表单应用程序,则当通过SelectedTabColor
选择选项卡时,可以修改选项卡的颜色。详情如下:
<?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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
SelectedTabColor="Black"
xmlns:views="clr-namespace:AppTab2.Views"
x:Class="AppTab2.Views.MainPage">
'...
</TabbedPage>
'...
注意:Xamarin表单的测试版本是
4.4.0.991265
我已将其作为一个问题提交,您可以在那里跟进。顺便说一下,我在Xamarin.Forms中找到了一个解决方法。你有时间可以看一下。我已经把它作为一个问题提交了,你可以在那里跟进。顺便说一下,我在Xamarin.Forms中找到了一个解决方法。你有时间可以看一看。它不起作用,选定的图标仍然是默认的color@Alessia您的项目中形成了什么版本的Xamarin?它不起作用,选定的图标仍然是默认图标color@Alessia您的项目中形成了什么版本的Xamarin?