Circular View

suggest change

For a circular View (in this case TextView) create a drawble round_view.xml in drawble folder:

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <solid android:color="#FAA23C" />
    <stroke android:color="#FFF" android:width="2dp" />
</shape>

Assign the drawable to the View:

<TextView
    android:id="@+id/game_score"
    android:layout_width="60dp"
    android:layout_height="60dp"
    android:background="@drawable/round_score"
    android:padding="6dp"
    android:text="100"
    android:textColor="#fff"
    android:textSize="20sp"
    android:textStyle="bold"
    android:gravity="center" />

Now it should look like the orange circle:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents