mardi 19 mai 2015

Android image display full height - loaded asynchronously

Hey I begin my adventure with Android and I can't solve one problem. I am loading pictures from web server using Universal Image Loader. I put them into Relative Layouts which is located in ListView. The effect that I want to achieve, is that pictures are displayed on the entire screen with full width and height with a small box at the bottom. In the IDE preview, everything looks ok: android image view

But on my phone loaded images look like that. I want them to be displayed with full height. It is necessary to use programming functions to achive it?

enter image description here

Loading images:

imageLoader.displayImage(
                wallpapers.get(position).getSrcUrl()//the drawable
                , currentWallpaperViewHolder.imageViewWallpaper//the image view
                , imageLoaderOptions);//the display options

return itemView;

List view:

<LinearLayout xmlns:android="http://ift.tt/nIICcg"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:orientation="vertical"
>
<ListView
    android:id="@+id/WallpapersListView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
</LinearLayout>

Image view:

<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

<ImageView
    android:id="@+id/wallpaper_image"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitXY"
    android:src="@drawable/test"
     />

<TextView
    android:id="@+id/wallpaper_date_for_use"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="20dip"
    android:padding="12dip"
    android:background="#AA000000"
    android:textColor="#ffffffff"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:gravity="center"
    android:textStyle="bold"
    android:text="Date of use" />
</RelativeLayout>

Aucun commentaire:

Enregistrer un commentaire