Макет ListActivity Custom - PullRequest
       3

Макет ListActivity Custom

0 голосов
/ 26 июня 2010

Я пытаюсь составить список, в котором каждая строка имеет текст сверху и снизу и еще одно изображение, выровненное по правому краю (как прикрепленное изображение).

но не могу. Кто-нибудь может мне помочь?

пример изображения:

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

1 Ответ

3 голосов
/ 26 июня 2010

Есть множество учебников и вопросов по этому поводу.

Просто упомяну несколько из поиска в Google:

Я не тестировал его, но ваша строка xml должна выглядеть примерно так:

<?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>
...