Problem with TableLayout

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Problem with TableLayout

Postby pmskiran » Sat Aug 22, 2009 4:10 pm

Hi,
Ands..
I got some problem with TableLayout please help me..

Problem is in the Tablerow-- Textviews are not aligned to left and right as i specified..

Please help me
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2.  
  3.         android:orientation="vertical" android:layout_width="fill_parent"
  4.  
  5.         android:layout_height="fill_parent" android:background="#654321">
  6.  
  7.  
  8.  
  9.         <TableLayout android:id="@+id/tablelo"
  10.  
  11.                 android:layout_width="fill_parent" android:layout_height="wrap_content"
  12.  
  13.                 android:orientation="vertical" android:visibility="invisible">
  14.  
  15.                 <TableRow android:id="@+id/tablerow" android:layout_width="fill_parent"
  16.  
  17.                         android:layout_height="wrap_content" android:orientation="horizontal">
  18.  
  19.                         <TextView android:text="   Count:  " android:id="@+id/TextView01"
  20.  
  21.                                 android:layout_width="wrap_content" android:layout_height="wrap_content"
  22.  
  23.                                 android:paddingLeft="5px" android:layout_gravity="left">
  24.  
  25.                         </TextView>
  26.  
  27.  
  28.  
  29.                         <TextView android:text=" Timer:   " android:id="@+id/TextView02"
  30.  
  31.                                 android:layout_width="wrap_content" android:layout_height="wrap_content"
  32.  
  33.                                 android:paddingRight="5px" android:layout_gravity="right">
  34.  
  35.                         </TextView>
  36.  
  37.                 </TableRow>
  38.  
  39.         </TableLayout>
  40.  
  41.  
  42.  
  43.         </LinearLayout>
  44.  
  45.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4


and give any suggestions to understand layouts clearly....
Kiran PMS
pmskiran
Junior Developer
Junior Developer
 
Posts: 12
Joined: Fri Jul 31, 2009 10:44 am
Location: India

Top

Postby progger » Sat Aug 22, 2009 10:15 pm

Hi,

put inside your TableLayout this definition:

android:stretchColumns="*"

default is "0"... you have to define the stretchColumns. And you can stretch all columns with "*" you can also specifiy a clear number like "1" oder "2"...

every special Layout like TableLayout, RelativeLayout, etc has his own definitions and with some practice you'll get familiar

Cheers
progger
Freshman
Freshman
 
Posts: 6
Joined: Wed Jul 29, 2009 11:21 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests