I am trying to display some text in a coloured circle, but it is not working properly. This is how I am rendering the text -
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GO"
android:background="@drawable/scancircle"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textColor="#ffffff"
android:textSize="18dp"
android:padding="9dp"
android:onClick="Go"
/>
And this is how scancircle.xml
looks like -
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadius="93dp"
android:thickness="1dp"
android:useLevel="false"
>
<solid android:color="@color/primary" />
<stroke
android:width="2dp"
android:color="@color/txtVwBackground"
/>
<padding
android:left="2dp"
android:right="2dp"
android:top="2dp"
android:bottom="2dp"
/>
</shape>
Even though the preview of scancircle shows the circle correctly, but there is no circle rendered behind the text. Can anyone tell why is this so?
Thanks in advance.