1

我的默认颜色是紫色(#9b59b6),我也想将顶部标题(蓝色)颜色更改为紫色。我在 Android 中自定义 Account Kit UI 的红色手册实现了这样的样式,但没有进一步的运气将顶部标题颜色更改为紫色。

//Delauft color: purple
UIManager uiManager = new SkinManager(SkinManager.Skin.CONTEMPORARY, ContextCompat.getColor(this, R.color.default_color), R.drawable.register_screen, SkinManager.Tint.WHITE, 0.1);
configurationBuilder.setUIManager(uiManager);

在我的style.xml我有

<style name="AppBaseTheme" parent="android:style/Theme.Light.NoTitleBar">
    <item name="colorPrimary">#9b59b6</item>
    <item name="colorPrimaryDark">#9b59b6</item>
    <item name="colorAccent">#9b59b6</item>
    <!-- other elements-->
</style>

其他活动正常。

我有看起来像这样的应用程序:

在此处输入图像描述

更新

解决方案:在AndroidManifest

<activity android:name="com.facebook.accountkit.ui.AccountKitActivity" android:theme="@style/CustomFbStyle" tools:replace="android:theme"/>

在 style.xml 中

<style name="CustomFbStyle" parent="Theme.AccountKit">
<item name="colorPrimary">#9b59b6</item>
<item name="colorPrimaryDark">#9b59b6</item>
</style>
4

1 回答 1

0

请检查您使用的主题,即 Appbasetheme 与您在清单的应用程序标签中提到的相同。

  <application
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppbaseTheme">

或者您也可以通过在清单中为该类提供 android:theme 标记来将特定主题用于特定类

于 2018-02-09T11:45:35.753 回答