How to view images in GridView with its original dimensions

nzs

New Member
I want to display a set of images in GridView (They have the same dimensions).Below the layout for the GirdView and the GirdView Item ..Teh problem is that the image height is stretched. why ?GridView layout : \[code\]<GridView android:id="@+id/gvRecipes" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentRight="true" android:layout_below="@+id/include1" android:layout_margin="0dp" android:background="@drawable/bg" android:gravity="right" android:horizontalSpacing="10dp" android:padding="0dp" android:verticalSpacing="5dp" ></GridView> \[/code\]GridView item is : \[code\]<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/include21" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:background="@drawable/btn" android:padding="5dp" > <ImageView android:id="@+id/imgRecibeImage" android:layout_width="match_parent" android:layout_height="wrap_content" android:scaleType="fitXY" android:src="http://stackoverflow.com/questions/12450438/@drawable/img1" /> <TextView android:id="@+id/txtRecibeName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_gravity="bottom" android:background="#80000000" android:gravity="right" android:padding="5dp" android:text="Crispy Chicken and Sandwich" android:textColor="#ffffff" android:textSize="17sp" /></FrameLayout>\[/code\]
 
Back
Top