TLDR
To resolve the styling issue, update the parent of AppTheme
from Light
to DayNight
in the main/res/values/styles.xml
file.
Details
The styling for your app is managed through XML files located in the main/res/values
folder. These files are automatically created by React Native or Expo, with the central file being styles.xml
.
Within this file, there is an element named AppTheme
:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">@android:color/black</item>
<item name="android:editTextStyle">@style/ResetEditText</item>
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
</style>
By default, the parent
property of AppTheme
is set to a Light
theme. Changing it to DayNight
resolved the issue:
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:textColor">@android:color/black</item>
<item name="android:editTextStyle">@style/ResetEditText</item>
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
</style>
Sources
I discovered this solution by referencing a similar example on GitHub. For more information on the DayNight
parent theme, check out Google's documentation.