I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/LinearLayout1"
style="#style/Fondo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:shape="rectangle" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:contentDescription="#string/descripcion"
android:scaleType="center"
android:src="#drawable/proyecto_logo1_aux" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/edittext_rounded_corners"
android:weightSum="19.0" >
<TableRow
android:id="#+id/TableRow05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:background="#drawable/edittext_rounded_corners" >
<TextView
android:id="#+id/levadura_data_Nombre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10"
android:textSize="20sp"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="#+id/TableRow04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_lab"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_lab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/TableRow03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_productid"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_idproduct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/TableRow02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_tipo"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_tipo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/TableRow01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_forma"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_forma"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_floculacion"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_floculacion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_celulas"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_celulas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_aten_min"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_aten_min"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/TableRow06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_aten_max"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_aten_max"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/TableRow07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/TextView04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_temp_min"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_temp_min"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/TableRow08"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0" >
<TextView
android:id="#+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_temp_max"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_temp_max"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#311b10" />
</TableRow>
<TableRow
android:id="#+id/TableRow09"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="8.0" >
<TextView
android:id="#+id/TextView07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_mejor"
android:textColor="#311b10" />
<TextView
android:id="#+id/levadura_data_mejor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:textColor="#311b10" />
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="5dp"
android:background="#drawable/edittext_rounded_corners"
android:weightSum="1.0" >
<TableRow
android:id="#+id/TableRow11"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" >
<TextView
android:id="#+id/TextView05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_notas"
android:textColor="#311b10"
android:textSize="15sp"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="#+id/TableRow17"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.9" >
<TextView
android:id="#+id/levadura_data_notas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusableInTouchMode="true"
android:focusable="true"
android:textColor="#311b10"
android:textSize="15sp" />
</TableRow>
</TableLayout>
</LinearLayout>
And couldn't show all text on android:id="#+id/levadura_data_mejor".
I don't know why.
For example, I do setText("Trappist Belgian Ales, Dubbles, Tripels and speciality Ales), but only is showing ["Trappist Belgian Ales, Dubbles, Tripels"]
I appreciate your help. Thx
Use android:layout_weight as shown below:
<TextView
android:id="#+id/TextView07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/levadura_mejor"
android:textColor="#311b10"
android:layout_weight="1"/>
<TextView
android:id="#+id/levadura_data_mejor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:text="Trappist Belgian Ales, Dubbles, Tripels and speciality Ales"
android:layout_weight="1"
android:textColor="#311b10" />
android:singleLine="false"
add the above line.
I am not really shure if this is solving Your problem, I don´t know If You want to make a line break or if You want to scroll the text, if it is longer than the view. But if You want to scroll it, set the following parameters:
android:ellipsize="marquee"
android:marqueeRepeatLimit="-1"
android:singleLine="true"
And in Your Java code class, You have to set Your TextView selected:
yourTextView.setSelected(true);
Related
Im trying to create a layout like following
Following is my code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:background="#drawable/border"
android:clipToPadding="false"
android:elevation="10dp"
android:orientation="vertical"
android:outlineProvider="bounds"
android:paddingBottom="10dp">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:stretchColumns="0,1,2">
<TableRow
android:id="#+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:gravity="center_vertical"
android:text="Proforma Inv.#" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:gravity="center"
android:text="Invoice#" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:gravity="center_vertical"
android:text="Status" />
</TableRow>
</TableLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#000" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:stretchColumns="0,1,2">
<TableRow
android:id="#+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/dashProformaInvoiceNo"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PI1:4000039"
android:textColor="#00ff00"
android:textStyle="bold" />
<TextView
android:id="#+id/dashInvoiceNo"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="INC 4000039"
android:textStyle="bold" />
<TextView
android:id="#+id/dashShippingStatus"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cargo shipped"
android:textStyle="bold" />
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:stretchColumns="*">
<TableRow
android:id="#+id/tableRow3"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
android:id="#+id/textView10"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Product:"
android:textStyle="bold" />
<TextView
android:id="#+id/dashProductName"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Biomass pellet"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
android:id="#+id/textView42"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rate: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashRate"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="USD 100"
android:textStyle="bold" />
</LinearLayout>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:stretchColumns="*">
<TableRow
android:id="#+id/tableRow4"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
android:id="#+id/textView5"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETD"
android:textStyle="bold" />
<TextView
android:id="#+id/dashETD"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="07 oct 2015 11.00"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
android:id="#+id/textView43"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Quantitiy: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashQuantity"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="600 Tons"
android:textStyle="bold" />
</LinearLayout>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:stretchColumns="*">
<TableRow
android:id="#+id/tableRow5"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETA: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashETA"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="06 OCT 2015"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/textView45"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Amount: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashAmount"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="USD 6000"
android:textStyle="bold" />
</LinearLayout>
</TableRow>
</TableLayout>
</LinearLayout>
The problem is that Im not be able to make the columns to have equal width. I have tried setting weight to all linear layouts but still the problem persists.
try this,
TableLayout
android:stretchColumns="*" // Optionally use numbered list "0,1,2,3,..."
>
<TableRow
android:layout_width="0dp"
>
You are giving wrap content as layout width for textviews. This is interfering with stretch columns.
Change width of all elements inside table layout as
android:layout_width="0dp"
Also why are you using so many table layout? You can put all table row tags inside one table layout and the below can also come inside table layout inbetween table rows.
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_span="3"
android:background="#000" />
android:layout_span="3" will make the view span all the columns.
Try this *edited i mean textview
<TextView
android:layout_width="0dp"
android:layout_weight="1"
/>
LinearLayout width must be android:layout_width="0dp" when provide weight to any layout
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">
<TextView
android:id="#+id/textView5"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETD"
android:textStyle="bold" />
<TextView
android:id="#+id/dashETD"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="07 oct 2015 11.00"
android:textStyle="bold" />
</LinearLayout>
I have solved it myself somehow
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp">
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:gravity="center_vertical"
android:text="Proforma Inv.#" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:gravity="center"
android:text="Invoice#" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:gravity="center_vertical"
android:text="Status" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/dashProformaInvoiceNo"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PI1:4000039"
android:textColor="#00ff00"
android:textStyle="bold" />
<TextView
android:id="#+id/dashInvoiceNo"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="INC 4000039"
android:textStyle="bold" />
<TextView
android:id="#+id/dashShippingStatus"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cargo shipped"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView10"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Product:"
android:textStyle="bold" />
<TextView
android:id="#+id/dashProductName"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Biomass pellet"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView42"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rate: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashRate"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="USD 100"
android:textStyle="bold" />
</LinearLayout>
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView5"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETD"
android:textStyle="bold" />
<TextView
android:id="#+id/dashETD"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="07 oct 2015 11.00"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView43"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Quantitiy: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashQuantity"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="600 Tons"
android:textStyle="bold" />
</LinearLayout>
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETA: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashETA"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="06 OCT 2015"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView45"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Amount: "
android:textStyle="bold" />
<TextView
android:id="#+id/dashAmount"
style="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="USD 6000"
android:textStyle="bold" />
</LinearLayout>
</TableRow>
</TableLayout>
What i have is an android activity with xml style .. i have two radio box and two text view with auto complete text view , the thing is i made a style with table layout to order my layout and here is my xml :
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5sp"
android:paddingRight="7dp"
android:text="الرجاء اختيار اسم العميل "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="24sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:text="الصيدليات"
android:textSize="20sp" />
<RadioGroup
android:id="#+id/radiolang"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!-- // here is error it says :The element type "RadioGroup" must be terminated by the matching end-tag "</RadioGroup>". -->
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<AutoCompleteTextView
android:id="#+id/txtsearch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:text="العملاء"
android:textSize="20sp" />
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RadioGroup>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<AutoCompleteTextView
android:id="#+id/txtsearch2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow6"
android:gravity="center_horizontal" >
<Button
android:id="#+id/button1"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_marginTop="50sp"
android:background="#ff9900"
android:text="متابعة"
android:textSize="22sp" />
</TableRow>
</TableLayout>
And the thing is a have a table row before the other radio box , how can i fix it so my radio group control the two radio boxes?? without destroying my style?
Update your xml file with this code
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5sp"
android:text="الرجاء اختيار اسم العميل "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="24sp" />
</TableRow>
<RadioGroup
android:id="#+id/radiolang"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:text="الصيدليات"
android:textSize="20sp" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<AutoCompleteTextView
android:id="#+id/txtsearch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:text="العملاء"
android:textSize="20sp" />
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<AutoCompleteTextView
android:id="#+id/txtsearch2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp" />
</TableRow>
</RadioGroup>
<TableRow
android:id="#+id/tableRow6"
android:gravity="center_horizontal" >
<Button
android:id="#+id/button1"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_marginTop="50sp"
android:background="#ff9900"
android:text="متابعة"
android:textSize="22sp" />
</TableRow>
</TableLayout>
Try this one
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5sp"
android:paddingRight="7dp"
android:text="الرجاء اختيار اسم العميل "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="24sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:text="الصيدليات"
android:textSize="20sp" />
<RadioGroup
android:id="#+id/radiolang"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RadioGroup>
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<AutoCompleteTextView
android:id="#+id/txtsearch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:text="العملاء"
android:textSize="20sp" />
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RadioGroup>
</RadioGroup>
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<AutoCompleteTextView
android:id="#+id/txtsearch2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow6"
android:gravity="center_horizontal" >
<Button
android:id="#+id/button1"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_marginTop="50sp"
android:background="#ff9900"
android:text="متابعة"
android:textSize="22sp" />
</TableRow>
</TableLayout>
I am building an app that is in 3 languages. The problem is that the text in textview is not aligning well. See image below -
I have set the gravity to start on all textviews.
I have tried Textview issue with text align, Android: Text in TextView not aligned well, How to align the textview to right in android?
The xml is as follows -
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#F2D77C"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
tools:context=".AdActivity" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F2D77C"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F2D77C"
android:visibility="gone"
android:weightSum="2" >
<TextView
android:id="#+id/topCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#F2D77C"
android:paddingBottom="7dp"
android:paddingLeft="5dp" />
<TextView
android:id="#+id/topPrice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="top|right|end"
android:layout_weight="1"
android:background="#F2D77C"
android:paddingRight="5dp"
android:textAlignment="textEnd"
android:textSize="20sp" />
</LinearLayout>
<!--
<HorizontalScrollView
android:id="#+id/horizontalScrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
-->
<!-- </HorizontalScrollView> -->
<ImageSwitcher
android:id="#+id/imageSwitcher1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="400dp" >
</ImageSwitcher>
<Gallery
android:id="#+id/gallery1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:spacing="5dp" />
<TextView
android:id="#+id/textViewPrice"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#F2D77C"
android:padding="5dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#262626" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Ad Code"
android:textStyle="bold"
android:textSize="20sp" />
<TextView
android:id="#+id/adCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Test code"
android:textSize="20sp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Viewed"
android:textStyle="bold"
android:textSize="20dp" />
<TextView
android:id="#+id/views"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="0"
android:textSize="20sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="4" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:minWidth="50dp"
android:padding="5dp"
android:text="#string/city"
android:textColor="#5B554E"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/city"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:gravity="start"
android:padding="5dp"
android:textAlignment="gravity"
android:textColor="#FFFFFFFF"
android:textSize="20sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="4" >
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:text="#string/date"
android:textColor="#5B554E"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/date"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:gravity="start"
android:padding="5dp"
android:textAlignment="gravity"
android:textColor="#FFFFFFFF"
android:textSize="20sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="4" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:text="#string/price"
android:textColor="#5B554E"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/price"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:gravity="start"
android:padding="5dp"
android:textAlignment="gravity"
android:textColor="#FFFFFFFF"
android:textSize="20sp" />
</TableRow>
</TableLayout>
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#20202020"
android:padding="5dp"
android:text="#string/description"
android:textColor="#6B5F53"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#F2E0A7"
android:minHeight="75dp"
android:padding="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp" />
<TextView
android:id="#+id/textView10"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#20202020"
android:padding="5dp"
android:text="#string/publisher_details"
android:textColor="#6B5F53"
android:textSize="20sp" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp" >
<TableRow
android:padding="5dp"
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="#string/name"
android:textColor="#6B5F53"
android:textStyle="bold" />
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="TextView"
android:textColor="#999999" />
</TableRow>
</TableLayout>
<Button
android:id="#+id/buttonCallCar"
style="#drawable/button_wh"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_margin="2dp"
android:background="#drawable/button_bl"
android:paddingBottom="5dp"
android:text="Call" />
<Button
android:id="#+id/buttonAltCall"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_margin="2dp"
android:background="#drawable/button_bl"
android:text="Call" />
<Button
android:id="#+id/buttonFacebook"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_margin="2dp"
android:background="#drawable/button_bl"
android:drawableLeft="#drawable/facebook"
android:text="#string/share" />
</LinearLayout>
</ScrollView>
</LinearLayout>
The problem is occurring in Kurdish and Arabic but not in English(see image for English).
I have been trying to make this Layout which contains a Textview in a TableLayout. The textview however doesn't fit inside the layout. It goes out of the boundary. Changing the width to fill_parent or wrap_content doesn't seem to fix it.
Please see this screenshot
The following is the xml code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ReportDetailActivity" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="#drawable/camera_icon" />
<TextView
android:id="#+id/textViewCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="center"
android:text="Pothole"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Comment : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Location : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaaaaadsk jfshdfhsdkh fdsfdshfkdshfk hsdkhfk sdhkfhsd;kfhs"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
</TableLayout>
Try add the layout_weight;
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Location : "
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="aaaaaadsk jfshdfhsdkh fdsfdshfkdshfk hsdkhfk sdhkfhsd;kfhs"
android:textAppearance="?android:attr/textAppearanceLarge" />
Try giving fix width to the textview. This will prevent from text going off the screen:
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Location : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewLocation"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="aaaaaadsk jfshdfhsdkh fdsfdshfkdshfk hsdkhfk sdhkfhsd;kfhs"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
Use this
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ReportDetailActivity" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="#drawable/camera_icon" />
<TextView
android:id="#+id/textViewCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="center"
android:text="Pothole"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Comment : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Location : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="aaaaaadsk jfshdfhsdkh fdsfdshfkdshfk hsdkhfk sdhkfhsd;kfhs"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date : "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textViewDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
</TableLayout>
</LinearLayout>
try to set fix layout_width to your textview and set maxlines or minlines attribute if needed.
If i use this layout, everything is ok
See this Image:
<TableLayout android:id="#+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#000000" android:layout_margin="10dip" android:padding="10dip" >
<TableRow android:id="#+id/row1" android:layout_width="wrap_content" android:layout_height="wrap_content" >
<TextView android:id="#+id/n1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:text="aaaaa a aaaaaaaaa:"></TextView>
<TextView android:id="#+id/c1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:layout_column="3" android:text="15"></TextView>
</TableRow>
<TableRow android:id="#+id/row2" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:id="#+id/n2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:text="aaaaaaa aaaaa:"></TextView>
<TextView android:id="#+id/c2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:layout_column="3" android:text="12"></TextView>
</TableRow>
<TableRow android:id="#+id/row3" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:id="#+id/n3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:text="aaa:"></TextView>
<TextView android:id="#+id/c3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:layout_column="3" android:text="14"></TextView>
</TableRow>
<TableRow android:id="#+id/row4" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:id="#+id/n4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:text="aaa:"></TextView>
<TextView android:id="#+id/c4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:layout_column="3" android:text="18"></TextView>
</TableRow>
<TableRow android:id="#+id/row5" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:id="#+id/n5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:text="aaaaaa aaaaaaaa:"></TextView>
<TextView android:id="#+id/c5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:layout_column="2" android:text="70"></TextView>
</TableRow>
</TableLayout>
But if i set android:layout_column="3" for the second textview in the last row, this shows http://www.lukafinzgar.com/nekul.png .
How should i set the attributes to get all the numbers in the third column?
You have to use "android:layout_width" and "android:layout_height" in TableLayout tag only. not anywhere else. And use "android:layout_weight" in each element of TableRow tag to adjust the columns horizontally.Try the below coding.
<TableLayout android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow>
<TextView android:id="#+id/cpotl1textview1"
android:layout_weight="0.5"
android:text="Total Outstanding" />
<EditText android:id="#+id/cpotl1edittext1"
android:layout_weight="0.5"
android:inputType="numberDecimal" />
</TableRow>
<TableRow>
<TextView android:id="#+id/cpotl1textview2"
android:layout_weight="0.5"
android:text="Claim Amount" />
<EditText android:id="#+id/cpotl1edittext2"
android:layout_weight="0.5"
android:inputType="numberDecimal" />
</TableRow>
<TableRow>
<TextView android:id="#+id/cpotl1textview3"
android:layout_weight="0.5"
android:text="Select Message" />
<AutoCompleteTextView android:id="#+id/cpotl1autocompletetextview"
android:layout_weight="0.5"
android:hint="Templates" />
</TableRow>
</TableLayout>
Thanks for opportunity.
Try This:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dip"
android:background="#000000"
android:padding="10dip" >
<TableRow
android:id="#+id/row1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/n1"
android:layout_width="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaaaa a aaaaaaaaa:"
android:textColor="#ffffff" >
</TextView>
<TextView
android:id="#+id/c1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="15"
android:textColor="#ffffff" >
</TextView>
</TableRow>
<TableRow
android:id="#+id/row2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/n2"
android:layout_width="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaaaaaa aaaaa:"
android:textColor="#ffffff" >
</TextView>
<TextView
android:id="#+id/c2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="12"
android:textColor="#ffffff" >
</TextView>
</TableRow>
<TableRow
android:id="#+id/row3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/n3"
android:layout_width="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaa:"
android:textColor="#ffffff" >
</TextView>
<TextView
android:id="#+id/c3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="14"
android:textColor="#ffffff" >
</TextView>
</TableRow>
<TableRow
android:id="#+id/row4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/n4"
android:layout_width="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaa:"
android:textColor="#ffffff" >
</TextView>
<TextView
android:id="#+id/c4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="18"
android:textColor="#ffffff" >
</TextView>
</TableRow>
<TableRow
android:id="#+id/row5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/n5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaaaaa aaarrrrrrraaaaa:"
android:textColor="#ffffff" >
</TextView>
<TextView
android:id="#+id/c5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="70"
android:textColor="#ffffff" >
</TextView>
</TableRow>
</TableLayout>