Issue
I am new to kotlin programming and i can't resolve the problem that i am facing in android studio. I followed a course on youtube, and at one point the video teaches you how to build an actual app. I want to change the backgroud color of a button that i made but whatever i do, the button keeps having the color purple.
I tryed this 2 methods:
android:background="@android:color/white"
android:background="#FFFFFF"
Can you help me guys, i would be really thankful
the entire code is: ( please do not mind the names i chose for the colors, im romanian)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/padding"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/backgroundColor"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="16dp"
tools:context=".MainActivity"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@android:color/white"
android:backgroundTint="@color/white"
android:text="Selecteaza data"
android:textColor="@color/culoarePrimara"
android:textSize="20sp"
android:textStyle="bold"
/>
</LinearLayout>
This is the color:
Solution
instead of android:background="@color/backgroundColor"
use: android:backgroundTint="@color/backgroundColor"
Answered By - YZN
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.