Android studio android文本视图颜色不变
我使用的是themeAndroid studio android文本视图颜色不变,android-studio,material-design,Android Studio,Material Design,我使用的是themetheme.MaterialComponents.DayNight。我可以通过编程或在xml中更改颜色文本,在emulator和一些我测试过的智能手机上也可以 但在物理荣誉10 lite上,我注意到文本颜色是黑色的,我无论如何都不能更改它(niether编程也不能从xml更改) 我甚至将它们改为主题.AppCompat.Light.NoActionBar,但没有机会 style.xml: <resources> <!-- Base application t
theme.MaterialComponents.DayNight
。我可以通过编程或在xml中更改颜色文本,在emulator和一些我测试过的智能手机上也可以
但在物理荣誉10 lite上,我注意到文本颜色是黑色的,我无论如何都不能更改它(niether编程也不能从xml更改)
我甚至将它们改为主题.AppCompat.Light.NoActionBar
,但没有机会
style.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="textAppearanceHeadline1">@style/TextAppearance.MyApp.Headline1</item>
<item name="fontFamily">@font/yekan</item>
</style>
<style name="TextAppearance.MyApp.Headline1" parent="TextAppearance.MaterialComponents.Headline1">
<!-- <item name="fontFamily">@font/custom_font</item>-->
<item name="android:textStyle">normal</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">32sp</item>
<item name="android:letterSpacing">0</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
@style/TextAppearance.MyApp.Headline1
@font/yekan
正常的
假的
32便士
0
假的
真的
文本视图:
<TextView
android:id="@+id/text_view_question"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginTop="16dp"
android:text="@{currentquestion.question.toString()}"
android:textColor="@android:color/holo_purple"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_view_category"
tools:text="@string/sample_qs" />