How to draw rounded rectangle in Android UI?
问题 I need to draw a rounded rectangle in the Android UI. Having the same rounded rectangle for TextView and EditText would also be helpful. 回答1: In your layout xml do the following: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@android:color/holo_red_dark" /> <corners android:radius="32dp" /> </shape> By changing the android:radius you can change the amount of "radius" of the corners. <solid> is used to define the color of the