使用 Theme.MaterialComponents 时,ElegantNumberButton 中 + 和 - 的颜色正在改变
When using Theme.MaterialComponents the color for + and - in ElegantNumberButton is changing
为了使用Chip和ChipGroup,我设置了Application style extends Theme.MaterialComponents
在 manifests.xml 中,然后 ElegantNumberButton 中“+”和“-”的颜色正在改变 before after
这是我的风格(使用 MaterialComponents 之后):
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<!-- <item name="colorPrimary">@android:color/transparent</item>-->
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorOnSurface">@color/black</item>
</style>
这是按钮
<com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
android:layout_width="100dp"
android:layout_height="30dp"
android:id="@+id/number_button"
android:layout_marginBottom="18dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
app:backGroundColor="#F42A42"
app:finalNumber="20"
app:initialNumber="1"
app:textSize="8sp"
/>
我能做什么?
看起来您的库还不能使用 Material 样式。使用bridge
版本的主题,
<style name="AppTheme" parent="Theme.MaterialComponents.Light.Bridge">
为了使用Chip和ChipGroup,我设置了Application style extends Theme.MaterialComponents 在 manifests.xml 中,然后 ElegantNumberButton 中“+”和“-”的颜色正在改变 before after
这是我的风格(使用 MaterialComponents 之后):
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<!-- <item name="colorPrimary">@android:color/transparent</item>-->
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorOnSurface">@color/black</item>
</style>
这是按钮
<com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
android:layout_width="100dp"
android:layout_height="30dp"
android:id="@+id/number_button"
android:layout_marginBottom="18dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
app:backGroundColor="#F42A42"
app:finalNumber="20"
app:initialNumber="1"
app:textSize="8sp"
/>
我能做什么?
看起来您的库还不能使用 Material 样式。使用bridge
版本的主题,
<style name="AppTheme" parent="Theme.MaterialComponents.Light.Bridge">