
As you can see on our example, we have a white color for text on our blueish button. To change the color of text, use attribute named textColor. However, you can select a color from Android resources. Then you need to change the backgrountTint attribute for that button. You use tint to make the icon blue.įirst, you need to add a normal button. It means that we only change color, imagine that you have an icon in black and white and you want it to be blue. We use tint to change the color of a button when we do not want to change the shape of the background. We show you how to set a background, how to choose a custom color (and how to add it to resources) and how to make a gradient color.

blue or green) and a cancel button (mostly red). Most of the time designers choose different colors for a confirmation button (e.g. Having different colors of buttons makes your application shine. Check our blog, if you need to learn more about using Android Studio Layout Editor. For most versions that would mean a grey button with all corners at 2dp roundness. To add a button, that has an Android style all you need to do is to drag and drop a button from the Palette to your layout. Using drawables to make gradients, dotted borders and more.You can add images to your buttons to customize them.Using custom shapes like circle, rounded corners and more.Using colors (background, text, border).You can make custom buttons in Android in many ways: Don’t worry CodeBrainer has 13 techniques for you to use. How to make a custom shape and how to add an image to a button and how to make a border for a button. We show you how to change colors, even how to make gradient colors. ConstraintLayout, or any other View) as well. Most of these design techniques work for many other types of components (e.g.

We wanted to create a short list of examples for you so that you have a cheat sheet to work on your next project. During all the years of mobile development, we had quite a few requests for button designs. We love custom buttons in Android apps they are always part of your work.
