# How to change the button color

**URL:** <https://discuss.kotlinlang.org/t/how-to-change-the-button-color/28157>\
**Category:** Android\
**Created:** [February 16, 2024, 1:32pm UTC](https://discuss.kotlinlang.org/t/how-to-change-the-button-color/28157 "2024-02-16T13:32:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dywkat](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@dywkat](https://discuss.kotlinlang.org/u/dywkat)\
**Post date:** [February 16, 2024, 1:32pm UTC](https://discuss.kotlinlang.org/t/how-to-change-the-button-color/28157/1 "2024-02-16T13:32:36Z")

</div>

Hello, i am use this code and my button did not to change. How to change the button color?

```auto
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#B3C328"/>
    <corners android:radius="950dp"/>
</shape>

```

I also included this file in the button’s specifications

```auto
<Button
        android:id="@+id/loginButton"
        android:layout_width="144dp"
        android:layout_height="52dp"
        android:layout_marginStart="29dp"
        android:layout_marginEnd="14dp"
        android:background="@drawable/round_button"
        android:hapticFeedbackEnabled="false"
        android:text="@string/login_button"
        android:textAlignment="center"
        android:textSize="12sp"
        android:typeface="normal"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/registrationButton"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.499" />

```

---

<div class="post-metadata">

**Author:** ![fvasco](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/fvasco/32/1961_2.png) [@fvasco](https://discuss.kotlinlang.org/u/fvasco)\
**Post date:** [February 17, 2024, 11:34pm UTC](https://discuss.kotlinlang.org/t/how-to-change-the-button-color/28157/2 "2024-02-17T23:34:30Z")

</div>

This is the Kotlin forum.
