I have a table layout in which i have two row. One row has a spinner and the other row has a checkbox as soon as set my spinner some value from dropdown the text of checkbox turn vertical .I tired all my tricks but can't find the solution or a reason this happen only at setting spinner runtime.
Anyone have faced this issue or have any idea about it would be a great help.
Thanks
Code
<TableLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#dedede"
android:orientation="vertical"
android:padding="5dp" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="2dp" >
<TextView
android:id="@+id/opPrem_txtName"
style="@style/iTV"
android:layout_width="0dp"
android:layout_marginLeft="3dp"
android:layout_weight="0.17"
android:gravity="left|center_vertical"
android:text="Name" />
<Spinner
android:id="@+id/opSpinner_salution"
style="@style/iET"
android:layout_width="0dp"
android:layout_weight="0.25"
android:entries="@array/Salutation" />
<EditText
android:id="@+id/opPrem_editName"
style="@style/iET"
android:layout_width="0dp"
android:layout_weight="0.56"
android:inputType="textCapWords|textNoSuggestions"
android:singleLine="true" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="2dp" >
<TextView
style="@style/iTV"
android:layout_width="0dp"
android:layout_marginLeft="3dp"
android:layout_weight="0.15"
android:gravity="center_vertical"
android:text="DOB " />
<EditText
android:id="@+id/pr_dobBtn"
style="@style/iET"
android:layout_width="0dp"
android:layout_weight="0.46"
android:singleLine="true" />
<TextView
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.05" />
<TextView
android:id="@+id/opPrem_txtAge"
style="@style/iTV"
android:layout_width="0dp"
android:layout_marginLeft="3dp"
android:layout_weight="0.15"
android:gravity="center_vertical"
android:text="Age" />
<EditText
android:id="@+id/opPrem_editAge"
style="@style/iET"
android:layout_width="0dp"
android:layout_weight="0.19"
android:inputType="number"
android:maxLength="2"
android:singleLine="true" />
<ImageButton
android:id="@+id/getContactReMain"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/button_background"
android:padding="4dp"
android:src="@drawable/getcontact" />
<ImageButton
android:id="@+id/saveContactReMain"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/button_background"
android:padding="4dp"
android:src="@drawable/addcontact" />
</TableRow>
</TableLayout>
I found the solution to this on my own. Just use android:stretchColumns="1,2" in table row containing the checkBoxlayout.
The number 1 and 2 indicates the value of view getting wrapped.
ex In my case the checkbox is the third view component of table row so used android:stretchColumns="2" this solved my prob :)