[android] Rounded corner for textview in android

  1. Create rounded_corner.xml in the drawable folder and add the following content,

    <solid android:color="#ffffff" />
    
    <padding
            android:left="1dp"
            android:right="1dp"
            android:bottom="1dp"
            android:top="1dp" />
    
    <corners android:radius="5dp" />
    
  2. Set this drawable in the TextView background property like so:

    android:background="@drawable/rounded_corner"
    

I hope this is useful for you.

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to textview

Kotlin: How to get and set a text to TextView in Android using Kotlin? How to set a ripple effect on textview or imageview on Android? The specified child already has a parent. You must call removeView() on the child's parent first (Android) Android: Creating a Circular TextView? android on Text Change Listener Android - Set text to TextView Placing a textview on top of imageview in android Rounded corner for textview in android Different font size of strings in the same TextView Auto-fit TextView for Android

Examples related to shapes

How to create a DataFrame of random integers with Pandas? Rounded corner for textview in android How to make gradient background in android Border in shape xml Multi-gradient shapes How to define a circle shape in an Android XML drawable file?