我想更改工具栏上后退符号的颜色,工具栏当前为黑色。为了视觉清晰,这里是左上角带有“后退”箭头的屏幕截图。正如您在屏幕截图中看到的,我已经更改了文本和背景的颜色。
该项目分为Client、Client.Android和Client.iOS。该应用程序目前主要针对 Android,但我们希望为 iOS 敞开大门。
如果有任何遗漏,我也会尝试将其粘贴在这里。
MasterDetailsPage.xaml.cs:
public partial class MasterDetailPage1: MasterDetailPage
{
public MasterDetailPage1()
{
this.InitializeComponent();
this.MasterPage.ListView.ItemSelected += this.ListView_ItemSelected;
}
protected override void OnChildAdded(Element child)
{
if(child is NavigationPage page)
{
page.BarBackgroundColor = Color.FromHex("343A40");
page.BackgroundColor = Color.FromHex("343A40");
page.BarTextColor = Color.FromHex("FFFFFF");
}
base.OnChildAdded(child);
}
}
Run Code Online (Sandbox Code Playgroud)
报表配置页面.xaml.cs
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="Company.Client.Views.ReportConfigurationPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<ContentPage.Content>
<ScrollView x:Name="ScrollView" BackgroundColor="White">
<StackLayout x:Name="BaseStackLayout" Orientation="Vertical">
<!-- Input controls -->
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)
更新:
啊,谢谢,这是DrawerArrowStyle需要在styles.xml …