While creating Android Apps,at times we face a need to create a view with rounded corners. This can be done by creating a XML file in the res/drawable folder whose content would be like:
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#D2E0E2" android:endColor="#D2E0E2"/> <corners android:bottomRightRadius="4dp" android:bottomLeftRadius="4dp" android:topLeftRadius="4dp" android:topRightRadius="4dp"/> </shape>
<TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/roundedView" />