Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

 2 Answer(s)

  • Create a shape in drawable folder like

    <shape xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="rectangle">
      <corners
        android:radius="10dip"/>
      <solid
        android:color="#F00" />
      <stroke
        android:width="2dip"
        android:color="#FFF" />
      <padding
        android:left="5dip"
        android:right="5dip"
        android:top="5dip"
        android:bottom="5dip" />
    </shape>
    

    Now create a Text view in your xml file and set its background to the above shape created.

    <TextView
      android:layout&#95;width="wrap&#95;content"
      android:layout&#95;height="wrap&#95;content" 
      android:text="10"
      android:textColor="#FFF"
      android:textSize="16sp"
      android:textStyle="bold"
      android:background="@drawable/badge&#95;circle"/>
    

    This will give the effect of text view with red color background now set this to the corner of any view like button or text etc.

    EX.

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout&#95;width="wrap&#95;content"
      android:layout&#95;height="wrap&#95;content">
      <Button
        android:id="@+id/myButton"
        android:layout&#95;width="65dip"
        android:layout&#95;height="65dip"/>
      <TextView
        android:id="@+id/textOne"
        android:layout&#95;width="wrap&#95;content"
        android:layout&#95;height="wrap&#95;content"
        android:layout&#95;alignTop="@id/myButton"
        android:layout&#95;alignRight="@id/myButton" 
        android:text="10"
        android:textColor="#FFF"
        android:textSize="16sp"
        android:textStyle="bold"
        android:background="@drawable/badge&#95;circle"/>
    </RelativeLayout>
    
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: