You can use the form resource for the background of your view, or oval:
<shape android:shape="oval"> <stroke android:width="1dp" android:color="#FF000000" /> </shape>
or rounded rectangle:
<shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#FF000000" /> <corners android:radius="20dp" /> </shape>
it is not clear to me, from your question, what you want to do for sure. The oval will match your objects in width and height.
Of course, you can have precise control through custom Drawable using your own draw () method and drawing on canvas. This is probably your best approach if you are looking for something very specific.
CSmith
source share