首页 > 解决方案 > 如何使用 Android Manifest 将 React Native Android 的默认文本颜色更改为黑色?

问题描述

在从 expo 中弹出我的应用程序以反应原生默认文本颜色为浅黑色后,我想将其更改为黑色,我尝试了很多次,但它没有改变,你知道该怎么做吗?

我的 Android 清单:

<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">

款式:

  <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:textColor">#FF00FF</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="android:windowTranslucentStatus">true</item>
  </style>

并且在更改 textColor 后它仍然具有相同的浅黑色..

标签: javascriptandroidreact-nativeexpo

解决方案


您需要将此行添加到布局文件中:

<TextView  style="@style/TextColor" />

推荐阅读