Header Ads

[Solved] android create a textview circle

-------------------------------------------------------------------------------------------------------------------------------
[ Time For Advertisement ]
/**
*  Did you play this game yet, try it now : "Faster Thinking"
*  Download from Google play:  

*  https://play.google.com/store/apps/details?id=com.thanhcs.fasterthinking
**/

-------------------------------------------------------------------------------------------------------------------------------
Create something like this one .


#1 : create circle.xml (in res/drawable)
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval" >

    <solid android:color="#aaf" />

</shape>
#2 : create circletext.xml (in res/layout):
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    android:orientation="vertical" >

    <TextView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_gravity="center"
        android:background="@drawable/circle"
        android:gravity="center"
        android:shadowColor="@android:color/white"
        android:shadowRadius="10.0"
        android:text="4"
        android:textColor="@android:color/black"
        android:textSize="18sp" />

</FrameLayout>
and at the result , it looks like this........... BINGGO
enter image description here

No comments:

Powered by Blogger.