C# 如何在跨平台上更改三个btn的颜色

C# 如何在跨平台上更改三个btn的颜色,c#,xaml,xamarin.forms,cross-platform,C#,Xaml,Xamarin.forms,Cross Platform,我不明白为什么带点的按钮没有显示出来。但单击此区域会打开下拉菜单 按钮上的点是白色的,它们与背景融为一体。我为android找到了一个解决方案,但我该如何着手为这个问题制定一个跨平台的解决方案呢 当Order属性设置为Secondary时,不同平台的行为会有所不同。在UWP和Android上,次要项目菜单显示为三个点,可以点击或单击以显示垂直列表中的项目。在iOS上,辅助项菜单作为水平列表显示在导航栏下方 一个简单的方法是更改工具栏的背景色 App.xaml.cs: var navPage

我不明白为什么带点的按钮没有显示出来。但单击此区域会打开下拉菜单

按钮上的点是白色的,它们与背景融为一体。我为android找到了一个解决方案,但我该如何着手为这个问题制定一个跨平台的解决方案呢


当Order属性设置为Secondary时,不同平台的行为会有所不同。在UWP和Android上,次要项目菜单显示为三个点,可以点击或单击以显示垂直列表中的项目。在iOS上,辅助项菜单作为水平列表显示在导航栏下方

一个简单的方法是更改工具栏的背景色

App.xaml.cs:

 var navPage = new NavigationPage(new Page2());
        this.MainPage = navPage;

        navPage.BarBackgroundColor = Color.Blue;

更新:

Android:

更改样式中3个点的颜色:

  <style name="MainTheme" parent="MainTheme.Base">  
<item name="android:textColorSecondary">#54FF9F</item> 
</style>

iOS:

就像我在前面的回复中所说的那样,ios上的次要项目菜单以水平列表的形式出现在导航栏下方

您可以改为使用
IOSToolbarExtensions

努吉:

安装它并将以下代码添加到AssemblyInfo.cs中:

[assembly: ExportRenderer(typeof(ContentPage), typeof(IOSToolbarExtensions.iOS.Renderers.IOSToolbarExtensionsContentPageRenderer), Priority = short.MaxValue)]

因为您没有发布任何相关的xaml/代码,所以无法判断您在做什么。@Jason我添加了代码我不想更改背景标题栏的颜色,我想更改带有3个点的按钮的颜色我已更新了回复。请检查一下。它适用于android,IOS呢?它将如何在iphone上显示?iOS不支持这三个点。您可以使用
IOSToolbarExtensions
instead@Winteriscoming这个案子有什么新消息吗?你解决这个问题了吗?
  <?xml version="1.0" encoding="utf-8"?>
 <androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:theme="@style/MainTheme"
android:popupTheme="@style/MainTheme.Base" 
 />
[assembly: ExportRenderer(typeof(ContentPage), typeof(IOSToolbarExtensions.iOS.Renderers.IOSToolbarExtensionsContentPageRenderer), Priority = short.MaxValue)]