In this Android tutorial, we'll create rounded corners with a
stroke -- or border. The finished code looks like this:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="24dp" /> <solid android:color="#9C27B0" /> <stroke android:width="4dp" android:color="#000" /> </shape>
We need to add a
radius to make the corners rounded,
solid to set the background color, and
stroke to set the border width and color.
The finished work looks like this:
Create beautiful buttons in XML.
Built with Android Studio and Kotlin.
Getting started is sometimes the hardest part.
Add a click listener in Kotlin.
Let users sign in.
It always begins with registration.