Android: Таблица Расположение раскладки
Я хочу «Длительность» и «Стоимость» Выравнивание по правому краю. Я пробовал этот код, но он не работает.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.markupartist.android.widget.ActionBar
android:id="@+id/actionBar"
style="@style/ActionBar" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:text="Date" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:text="Couse Name" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:layout_gravity="right"
android:text="Duration" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:layout_gravity="right"
android:text="Cost" />
</TableRow>
</TableLayout>
</LinearLayout>
layout_gravity = "right" не работает. I trird gravity = "ritght", но это тоже не работает. Я также хочу, чтобы каждый столбец был выровнен по центру.
Спасибо. :) – SkyWalker
Да, конечно !! Могу ли я установить вес TextView из кода? – SkyWalker
Вы можете установить его с помощью LayoutParams – Sniper