Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to make a button with rounded edges?

what is the essence of the question:

  1. Why is the color that I write in solid in the shape not taken into account
  2. Why do I have a white background on the back of the button now (attached a photo)? I don’t understand where I can fix itbackground button

I found a video on YouTube and there was the following solution: Create an xml file in drawable and there I specified the following:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="oval">
        <solid android:color="@color/teal_700"></solid>
    </shape>
</item>
</selector>

The problem is that when the videos came out, there were no themes and everything worked out perfectly right away, and I tried to figure out why I didn’t apply color to the button if I set it in the shape, but I never figured it out and it doesn’t take into account my color that I set in solid 🙂 I decided to change the primaryColor in the theme to the color I needed and then it applied.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

And can you also throw, please, useful modern resources to the latest versions of android studio? I’m just learning, so I haven’t found much yet and it would be interesting to see some examples for new updates, because all the videos are from earlier versions and some of them don’t converge, as, for example, now in the question

If there are not enough details to solve the problem, then write to me

>Solution :

To make A Button Round Use MaterialButton

<com.google.android.material.button.MaterialButton
    android:layout_width="100dp"
    android:layout_height="50dp"
    android:text="1"
    app:cornerRadius="18dp" />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading