I have a horizontal linear layout with multiple text views in it. The layout has a width of fill_parent and height of wrap_content. My issue is that when the text views are longer than the allowed screen width of my device, it smashes the last text view to the right instead of wrapping it to a new line (which is my desired result). I thought having a height of wrap_content would solve this.
What can i do to make it so my linear layout with multiple text views will wrap the text views if they exceed the width of the parent?
Here is a snippet from my layout:
<LinearLayout
android:id="@+id/linearLayout20"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="3dip" >
<TextView android:layout_height="wrap_content" android:textColor="@color/black" android:text="Car Info: " android:id="@+id/textView023" android:layout_width="wrap_content" android:textStyle="bold" android:textSize="@dimen/item_main_text_size"></TextView>
<TextView android:layout_height="wrap_content" android:textColor="@color/black" android:text="2005" android:id="@+id/autorental_item_caryear" android:layout_width="wrap_content" android:textSize="@dimen/item_main_text_size"></TextView>
<TextView android:layout_height="wrap_content" android:textColor="@color/black" android:paddingLeft="3dip" android:text="Chevy" android:id="@+id/autorental_item_carmake" android:layout_width="wrap_content" android:textSize="@dimen/item_main_text_size"></TextView>
<TextView android:layout_height="wrap_content" android:textColor="@color/black" android:paddingLeft="3dip" android:text="Rio" android:id="@+id/autorental_item_carmodel" android:layout_width="wrap_content" android:textSize="@dimen/item_main_text_size"></TextView>
<TextView android:layout_height="wrap_content" android:textColor="@color/black" android:paddingLeft="3dip" android:text="-" android:id="@+id/textView2" android:paddingRight="3dip" android:layout_width="wrap_content" android:textSize="@dimen/item_main_text_size"></TextView>
<TextView android:layout_height="wrap_content" android:textColor="@color/black" android:paddingLeft="3dip" android:text="Red" android:id="@+id/autorental_item_carcolor" android:layout_width="wrap_content" android:textSize="@dimen/item_main_text_size"></TextView>
</LinearLayout>
With long textviews, it renders something like this:
Car Info: 2002 Chevrolet Silverado - Pu
rp
le
and I would like it to be something like this:
Car Info: 2002 Chevrolet Silverado -
Purple