gpt4 book ai didi

xamarin.forms - Xamarin 表单 Android 工具栏文本颜色

转载 作者:行者123 更新时间:2023-12-03 15:57:17 27 4
gpt4 key购买 nike

工具栏颜色默认为白色,我想将其更改为蓝色。我能够改变几乎所有的东西,但不是那个。

工具栏.axml

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

样式文件
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:textColorPrimary">#1b2b32</item>
<item name="android:textColorSecondary">#1c4d9e</item>

logout text is always in white

最佳答案

我找到了一种方法。它与我在那里读到的所有答案混合在一起。
我使用了这个答案
Change color of ToolBarItem in XAML @Guillermo Daniel Arias。
关于styles.XML

<item name="android:actionMenuTextColor">#1c4d9e</item>

在 App.xml 上(在 xamarin 表单共享项目上)
 <Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="White"/>
<Setter Property="BarTextColor" Value="#004895"/>
</Style>

enter image description here

关于xamarin.forms - Xamarin 表单 Android 工具栏文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52063754/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com