안드로이드 스튜디오의 에뮬레이터 상에서는 NumberPicker 부분이 분명히!!! textColor가 잘 적용됐는데, 왜 기기에 직접 빌드했을 경우에는 textColor가 흰색으로 고정이 되는걸까...?
<!-- Number Picker 텍스트 색상 -->
<style name="AppTheme.Picker" parent="Theme.AppCompat.Light.NoActionBar" >
<item name="android:textColorPrimary">@color/font_color</item>
</style>
나는 다크모드 적용을 위해 colors.xml 파일에 font_color라는 색상을 정의해뒀기 때문에 해당 색상을 적용해줬다.
android:theme="@style/AppTheme.Picker"
로 바꿔준다.<NumberPicker
android:id="@+id/yearPicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.Picker"
app:layout_constraintEnd_toStartOf="@id/yearTitle"
app:layout_constraintStart_toStartOf="@id/dialogBloodGuideline"
app:layout_constraintTop_toBottomOf="@id/birthDialogTitle" />
@color/font_color
가 잘 적용되었다!!! (다크모드일 때 : 흰색 / 다크모드가 아닐 때 : 검은색)