Images in the Gallery not stretching/scaling to the whole screen in Landscape
<p>Hey, I have a Gallery in a ScrollView, the problem is that when in Landscape, the images are not scaled to fill the screen, Here is a screenshot: <img src="http://i.stack.imgur.com/YbTjF.png" alt="picture"> (ignore the toast)<br>
As you can see the image in the middle is the one that is currently selected, but you can see that in the left/right sides of the screen parts of the next/previous images are also displayed.. how can I make the image in the middle get scaled to the whole screen?<br>
ImageAdapter class: </p>

<pre><code>public class ImageAdapter extends BaseAdapter {
    int mGalleryItemBackground;
    int counter =0 ;
    private Context mContext;

    public String[] mImageIds;

    public ImageAdapter(Context c) {
        mContext = c;
        TypedArray a = c.obtainStyledAttributes(R.styleable.Gallery1);
        mGalleryItemBackground = a.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);
        a.recycle();
    }

    public void insert(String string)
    {
        mImageIds[counter]=string;
        counter++;
    }

    public int getCount() {
        return mImageIds.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView i = new ImageView(mContext);

        i.setImageBitmap(BitmapFactory.decodeFile(mImageIds[position]));
        i.setScaleType(ImageView.ScaleType.FIT_XY);
        i.setBackgroundResource(mGalleryItemBackground);

        return i;
   }
}
</code></pre>

<p>xml:</p>

<pre><code>  &lt;/Gallery&gt;
    &lt;ScrollView 
    android:id="@+id/QuranGalleryScrollView" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"&gt;
    &lt;Gallery android:id="@+id/GalleryLandscape" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"&gt;
    &lt;/Gallery&gt;
</code></pre>

<p>Thanks.</p>

<p>Edit1:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:id="@+id/relative"&gt;


    &lt;Gallery android:id="@+id/Gallery" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"&gt;
    &lt;/Gallery&gt;
    &lt;ScrollView 
    android:id="@+id/QuranGalleryScrollView" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"&gt;
    &lt;Gallery android:id="@+id/GalleryLandscape" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"&gt;
    &lt;/Gallery&gt;
&lt;/ScrollView&gt;
 &lt;....other relative views here....&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>{I'm also using other Relative views so they get displayed above the gallery, though this is at the top of xml..</p>
