How do you get a view to position itself left, right and center in a TableLayout row? Or linear layout?
Asked
Active
Viewed 617 times
0
-
Refer to [this answer](http://stackoverflow.com/questions/1292575/android-textview-justify-text/2899082#2899082) – Reno Nov 14 '12 at 07:38
1 Answers
0
You can use the android:gravity property to set the alignment you want.
<TableRow android:gravity="center">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:gravity="center">
</LinearLayout>
</TableRow>
When working on the TableLayout, look for the streachColoum property. Also make it * if you want all the table columns to auto fit.

Peter Mortensen
- 30,738
- 21
- 105
- 131

Rohit Mandiwal
- 10,258
- 5
- 70
- 83
-
Is the name actually *"streachColoum"*? For instance, *"Coloum"* is close to *"[Column](https://en.wiktionary.org/wiki/column#Noun)"*. – Peter Mortensen Nov 04 '21 at 04:58