Skip to content Skip to sidebar Skip to footer

How To Draw A Dot Circle Inside A Square Drawable In Android?

I want a small dot inside a square button , this is what i have tried till now as answered by azizbekian:

Solution 1:

first create color_circle in drawable

<?xml version="1.0" encoding="utf-8"?><shapexmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval"><solidandroid:color="#ffffff"></solid><sizeandroid:width="48dp"android:height="48dp" /></shape>

and then

<RelativeLayoutandroid:layout_width="64dp"android:layout_height="148dp"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"><Buttonandroid:textAllCaps="true"android:textStyle="bold"android:layout_width="match_parent"android:layout_height="match_parent"android:text="WED" /></LinearLayout><Viewandroid:layout_width="16dp"android:layout_height="16dp"android:layout_alignParentBottom="true"android:layout_centerHorizontal="true"android:layout_marginBottom="16dp"android:background="@drawable/color_circle" /></RelativeLayout>

i hope this is what you want

Solution 2:

This is

ImageView has src to dotted.xml.

<ImageViewandroid:layout_width="178.8dp"android:layout_height="178.8dp"android:src="@drawable/dotted"android:layout_centerInParent="true"android:layerType="software" />
add below to drawable/dotted.xml
<?xml version="1.0" encoding="utf-8"?><shapexmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval"><strokeandroid:color="@android:color/white"android:dashWidth="1px"android:dashGap="10px"android:width="6.6dp"/></shape>

Post a Comment for "How To Draw A Dot Circle Inside A Square Drawable In Android?"