How to round corners and create a border for a TextView or EditText

Step one 

Create a Android Resource Directory called drawables within the res file if you don’t already have one.

Step two

Make a new xml page called whatever you like. I called mine rounded_corner_background.

Step three

Within the xml page you have just created add:

<?xml version="1.0" encoding="UTF-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#ffffffff"/> <!--Background color-->
    <corners android:radius="5px"/>
    <stroke android:width="1dip" android:color="#000"/> <!--outline stroke -->
    <padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>

One thought on “How to round corners and create a border for a TextView or EditText

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s