I need to have various text view on a single line. And I want then to be in single line centered. As if they are written in single text view. So I used Linear layouts. But my problem is when i am tilting it to portrait orientation, text are dropping vertically. I want that if text are not fitting in screen then they must come to next line CENTERED on tilt. My problem is somewhat same as https://stackoverflow.com/questions/9596493/linear-layout-is-not-keeping-text-view-in-center. Please can any body help in this. My layout.xml is as below…..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
//some code here
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="30dp"
android:layout_gravity="center_horizontal" >
<TextView
android:id="@+id/tv_jobs_info_note"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="@string/jobs_info_note"
android:textSize="20dp"
android:paddingRight="5dp"
/>
<TextView
android:id="@+id/tv_my_job"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/my_job"
android:clickable="true"
android:textColor="#0000FF"
android:onClick="onWorkListClick"
android:textSize="20dp"
android:paddingRight="5dp"
/>
<TextView
android:id="@+id/tv_jobs_info_note_mid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="@string/jobs_info_note_mid"
android:textSize="20dp"
android:paddingRight="5dp"
/>
<TextView
android:id="@+id/tv_team_job"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#0000FF"
android:clickable="true"
android:onClick="onWorkListClick"
android:text="@string/team_job"
android:textSize="20dp"
android:paddingRight="5dp"
/>
<TextView
android:id="@+id/tv_jobs_info_note_end"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/jobs_info_note_end"
android:textColor="#000000"
android:textSize="20dp"
android:paddingRight="5dp"
/>
</LinearLayout>
//Some more code here
<ImageView
android:id="@+id/img_current_job_map"
android:layout_gravity="center_horizontal|bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/map" />
</LinearLayout>
Is there some other way to do this,Any help will be appreciated.
I tried using different font size. Although its not the correct way but still there was no option left.