Здравствуйте, я хочу, чтобы макет выглядел как http://developer.android.com/images/training/layout-listitem.png вместо изображения, которое слева. Я хочу кнопку справа. Но моя кнопка сразу после того, как текстовое представление не попадает вправо. Я искал другие решения, но мне ничего не помогло. Вот что у меня есть.Правильное решение макета - андроид
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="12pt"
android:id="@+id/view_to" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="8pt"
android:id="@+id/view_what" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/b_send"
android:id="@+id/b_send" />
</LinearLayout>
</LinearLayout>
Заранее спасибо.
Использование 'RelativeLayout'. Гораздо более гибкий для такого макета. – Simon
моя кнопка не наклеивается на правый край, но сразу после длинного textView – miskohut
в редакторе это нормально, но это происходит, когда я запускаю приложение. Я должен был упомянуть об этом. – miskohut