Issue
I need to create a circle with number. But the problem is that some numbers is not in center, for example 1 stayed right from center.
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="18dp"/>
<solid android:color="@color/black"/>
</shape>
This Drawable is background of TextView
Solution
Try use attribute
android:includeFontPadding="false"
<TextView
android:layout_width="18dp"
android:layout_height="18dp"
android:background="@drawable/test"
android:gravity="center"
android:textColor="@color/colorAccent"
android:includeFontPadding="false"
android:text="1"/>
Answered By - SergeyBukarev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.