views:

32

answers:

1

I'm trying to make a list where each row has a text at the top and bottom and another one image aligned right (like the image attached).

but I can not. Could anyone help me?

sample image:

http://www.freeimagehosting.net/uploads/fb6e2055f5.png

A: 

There are plenty of tutorial and questions about it.

Just to mention a few from a google search:

I didn't test it, but your row xml should be something like this:

<?xml version="1.0" encoding="utf-8"?>
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <TextView android:id="@+id/green_title"
      android:textSize="25sp"
      android:textColor="#00FF00"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:text="Text1"/>

    <TextView android:id="@+id/sub_title"
      android:textSize="15sp"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@id/green_title"
      android:text="Text2"/>

    <ImageView android:id="@+id/image"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:src="@drawable/image"
      android:layout_alignParentRight="true"
      android:layout_below="@id/green_title"/>
  </RelativeLayout>
Macarse
want the image aligned right :(
Sand
@Sand: Check the first link. It talks about a row.xml. There you will do your own view for each row. Use a RelativeLayout or a LinearLayout and place the image on the right and that's it.
Macarse
@Macarse: but how do you align the image on the right?
Sand
@Sand: I will edit my answer adding how to place the image on the right. But it has nothing to do with this question :(
Macarse
Thank'sss Macarse!!!!
Sand