title: Android ImageView layout gravity not working
body: <p>hi guys i don't have the answer for this question. Hope you could help. layout_gravity property as center it is not working when i set the scale type property to matrix. And also i am using the pinch zoom for that imageview. so if i can set the image and set if the image is small then it  would be very fine. Hoping for the better responses. Thanks in Advance...</p>
  
  <p>Edit #1:
  My ImageView follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:background="@drawable/bg"&gt;
  
  &lt;LinearLayout android:layout_width="fill_parent"
      android:id="@+id/linear_titile_bar" android:layout_height="wrap_content"
      android:background="@drawable/top_black_logo_bg"&gt;
  
      &lt;Button android:layout_width="wrap_content"   android:id="@+id/myphotos_gridview_back"
          android:layout_height="wrap_content" android:background="@drawable/back_gray_bt"
          android:layout_gravity="center_vertical" android:layout_margin="5dip"&gt;   &lt;/Button&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout android:layout_width="fill_parent"
      android:id="@+id/nameTitlebar" android:layout_below="@+id/linear_titile_bar"
      android:layout_height="wrap_content" android:background="@drawable/title_gray_bg"&gt;
  
      &lt;TextView android:layout_width="fill_parent"
          android:layout_height="fill_parent" android:gravity="center"
          android:text="MY PHOTOS" style="@style/ivideodate.blue.large"&gt;&lt;/TextView&gt;
  &lt;/LinearLayout&gt;&lt;!-- android:layout_above="@+id/FooterLayout" --&gt;
  
  &lt;LinearLayout android:layout_width="fill_parent"
      android:layout_height="fill_parent" android:layout_below="@+id/nameTitlebar"
      android:layout_above="@+id/FooterLayout" android:gravity="center"&gt;
  
      &lt;ImageView android:layout_width="fill_parent" android:scaleType="matrix"
          android:layout_gravity="center" android:layout_height="fill_parent"
          android:id="@+id/ProfileImageView" /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout android:layout_height="wrap_content"
      android:background="@drawable/my_photo_edit_but_bg"
      android:layout_width="fill_parent" android:layout_alignParentBottom="true"
      android:id="@+id/FooterLayout" android:orientation="vertical"
      android:gravity="center"&gt;
  
      &lt;Button android:background="@drawable/set_profile_pic_bt"
          android:layout_width="wrap_content" android:layout_height="wrap_content"
          android:scaleType="fitCenter" android:id="@+id/setprofileimage" /&gt;
      &lt;Button android:background="@drawable/delete_photo_bt"
          android:layout_width="wrap_content" android:layout_marginTop="5dip"
          android:layout_height="wrap_content" android:scaleType="fitCenter"
          android:id="@+id/deleteimage" /&gt;
  
  &lt;/LinearLayout&gt;
  
   &lt;/RelativeLayout&gt;
  </code></pre>