Android Drawables edit

Circular View

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
39 ACRA
64 Menu
112 Loader
119 Xposed
131 Drawables
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close