views:

40

answers:

1

Hi I want to create a grid of images with text right below the images.

I created in a xml file a image_text item which basically is a linearlayout with and imageview and a textview right below.

I created a tablelayout and I want to add my custom image_text.xml to the table row. But I dont know how to reference my xml file inside. If I use the include statament, how do I pass the image id and text to my item_text.xml?

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:shrinkColumns="1"
android:stretchColumns="1"
android:padding="@dimen/inner_layout_horizontal_padding"
android:background="@drawable/base_bg_section">

<TableRow>

</TableRow>

Hope that this make sense and you can help me. any help will be greatly appreciated.

A: 

Some of the words in my first post are gone (weird). I added some words here If I use the include statement,

ram
@ram - you get a preview of your post when you type it in. I have made the edits to correct the issue, so you can delete this "answer" now.
Oded