Issue
I need to draw a rounded rectangle in the Android UI. Having the same rounded rectangle for TextView and EditText would also be helpful.
Solution
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 drawable.
You can use replace android:radius with android:bottomLeftRadius, android:bottomRightRadius, android:topLeftRadius and android:topRightRadius to define radius for each corner.
Answered By - Andreass
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.