Issue
Need to draw the following circle , with the red colour shape using xml.
Is it possible to draw this using xml only?
Solution
You can make circle using the following XML
code:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
<solid android:color="#c4bfbf"/>
</shape>
You can add the above circle as the background to a view, and on top of that view you could keep another view, which could be center vertical, and it's XML
would be:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#FF0000" />
<padding android:bottom="1dp" android:left="10dp" android:right="10dp" android:top="1dp"/>
<corners
android:bottomRightRadius="20dp"
android:bottomLeftRadius="20dp"
android:topLeftRadius="20dp"
android:topRightRadius="20dp"/>
</shape>
Answered By - Eric B.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.