I have button in android studio xml file and its not changing shape and color when I change it
i dont wanna make my own styles
how it looks
here is my code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.PlantsListFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="#1F1F27">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/spaces"
android:textColor="@color/white"
android:textSize="20sp"
android:layout_centerInParent="true"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rounded_square"
android:backgroundTint="#1C2F33" />
</RelativeLayout>
</FrameLayout>
also here is my rounded_square.xml file if needed:
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#1C2F33" />
<corners android:radius="30dp" />
</shape>
I wanted this button to be color “#1C2F33” and I want it to have rounded corners
New contributor
Paeqw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.