Open top menu


In this tutorial implement the circle ImageView in Android.we will drow the design in xml using eclipse.
first, we will create a gradient class in Drawable folder my class is cercle_image.xml.





...................................................................................................................................................................
<?xml version="1.0" encoding="UTF-8" ?>
  <shape xmlns:android="http://schemas.android.com/apk/res/android">
  <solid android:color="#000000" />
  <stroke android:width="3dp" android:color="#776da8" />
  <corners android:bottomRightRadius="100dp" android:bottomLeftRadius="100dp" android:topLeftRadius="100dp" android:topRightRadius="100dp" />
  <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" />
  </shape>





then you have set the class in ImageView in main class
..............................................................................................................................................................
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
     android:background="#000000">

    <ImageView
        android:id="@+id/image"
        android:layout_width="200dip"
        android:layout_height="200dip"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:scaleType="centerCrop"
        android:background="@drawable/cercle_image"
        android:src="@drawable/iconprofile" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="42dp"
        android:gravity="center"
        android:textSize="20sp"
        android:textStyle="bold"
        android:textColor="#ffffff"
        android:text="AndroidBeginner Tutorial point" />

</RelativeLayout>



0 comments