user8006332 user8006332 -4 years ago 46
Android Question

Gallery image with text in list view

I am working on QR generator app and I want to do display listview of gallery images with text which i entered for generating qr code. I want to do like this...
[![gallery image with text]][1]][1]

**I want to display data which I entered.

Answer Source

Create a custom adapter and you can use this layout for each item.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
    android:layout_width="150dp"
    android:layout_height="150dp"
    android:id="@+id/imageView"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="Large Text"
    android:id="@+id/textView"
    android:layout_alignParentTop="true"
    android:layout_toEndOf="@+id/imageView" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Medium Text"
    android:id="@+id/textView2"
    android:layout_below="@+id/textView"
    android:layout_toEndOf="@+id/imageView"
    android:layout_marginTop="49dp" />

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download