Answer the question
In order to leave comments, you need to log in
Why can't I change the color of the button?
Previously, by specifying background black on the view, you could change the color (for example, buttons). It could also be done via style. Now it doesn't work for some reason.
I have an idea that this is due to the update of android studio and the appearance of the themes folder in the values. Maybe I'm wrong
Who knows what's wrong. Tell me plz.
<com.google.android.material.button.MaterialButton
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginEnd="@dimen/margin_button"
android:layout_marginStart="@dimen/margin_button"
android:layout_marginBottom="@dimen/margin_button"
android:background="@color/coral"
/>
<style name="Theme.Smoke" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryVariant">@color/coral</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<item name="buttonBarStyle">@color/coral</item>
<item name="android:buttonStyle">@color/coral</item>
</style>
<style name="SplashScreenTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_image</item>
</style>
<style name="ThemeOverlay.Smoke.FullscreenContainer" parent="">
<item name="fullscreenBackgroundColor">@color/light_blue_600</item>
<item name="fullscreenTextColor">@color/light_blue_A200</item>
</style>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question