Различные элементы в строке ListView - пример скриншота - PullRequest
1 голос
/ 19 июня 2010

Я хочу добиться такого вида строк в моем приложении.

У меня уже есть макет ImageView / TextView, но я хочу, чтобы это «положительное» маленькое изображение справа всегда отображалось точно так жеместо!

http://cache.ctoof.com/2010/03/gowalla-1.png

Спасибо!

1 Ответ

1 голос
/ 19 июня 2010

Вероятно, с помощью гравитации сделаем эту работу

android:layout_gravity="center_vertical|right"

См. Этот образец взят из одного из моих взглядов

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/LinearLayout01"
        android:gravity="center_vertical"
        android:orientation="horizontal">
        <LinearLayout
            android:layout_width="0dip"
            android:layout_weight="1"
            android:paddingRight="8dip"
            android:layout_height="wrap_content"
            android:id="@+id/LinearLayout01"
            android:orientation="vertical">
        ....
        </LinearLayout>
        <ImageView
            android:id="@+id/imgArrowRight"
            android:src="@drawable/tab_right_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dip"
            android:layout_gravity="center_vertical|right"></ImageView>
    </LinearLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...