Android table width queries
Posted
by
user1653285
on Stack Overflow
See other posts from Stack Overflow
or by user1653285
Published on 2012-10-04T23:36:16Z
Indexed on
2012/10/05
3:37 UTC
Read the original article
Hit count: 432
android
|android-tablelayout
I have a table layout (code below), but I have am having a bit of a problem with the width of the cells. The picture below shows the problem. There should be a white border on the right hand side of the screen. I also want the text "Auditorium" not to wrap onto a new line (I would prefer that "13th -" get put onto the new line instead, I don't want to put \n in there because then it would mean it goes onto a new line at that point on bigger screens/landscape view).
How can I fix those two problems?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#013567" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*" >
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/textlines"
android:gravity="center"
android:text="@string/meeting_5"
android:textColor="#fff" >
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/textlines"
android:gravity="center"
android:text="@string/meeting_5_date"
android:textColor="#fff" >
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/textlines"
android:gravity="center"
android:text="@string/meeting_5_location"
android:textColor="#fff" >
</TextView>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/textlines"
android:gravity="center"
android:text="@string/AGM"
android:textColor="#fff" >
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/textlines"
android:gravity="center"
android:text="@string/AGM_date"
android:textColor="#fff" >
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/textlines"
android:gravity="center"
android:text="@string/AGM_location"
android:textColor="#fff" >
</TextView>
</TableRow>
</TableLayout>
© Stack Overflow or respective owner