
I want ‘Duration’ and ‘Cost’ Right aligned. I tried this code but it’s not working.
<?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” not working.
I trird gravity=”ritght” but that’s also not working.
I also want each column to center aligned.
give weight for Table row and all the text views…