TextView cutting off lines because of parent's LinearLayout wrap_content in android

toro484

New Member
What I want to do is make a centered box containing some text blurbs and a button to proceed. I was able to get the box centered and not taking up the entire screen by using wrap_content, but the blurbs are several lines long, and the textviews containing them are not showing all the text. Here is what I have:\[code\]<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:background="@color/background" android:orientation="vertical" > <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center" android:background="@color/content" android:padding="10dp" > <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:text="@string/title" android:textColor="@color/black" /> <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/teacher_head" android:textColor="@color/black" /> <TextView style="@style/home_blurb" android:text="@string/teacher_blurb" /> <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/student_head" android:textColor="@color/black" /> <TextView android:text="@string/student_blurb" style="@style/home_blurb" /> <Button android:layout_width="wrap_content" android:layout_height="0dip" android:layout_gravity="center" android:layout_weight="0.1" android:gravity="center" android:paddingTop="5dp" android:text="@string/go_to_app" /></LinearLayout></LinearLayout>\[/code\]where home_blurb is\[code\]<style name="home_blurb" parent="android:TextAppearance"> <item name="android:paddingBottom">5dp</item> <item name="android:textColor">@color/black</item> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">fill_parent</item> <item name="android:layout_weight">1</item> <item name="android:textSize">12dp</item> </style>\[/code\]The inner LinearLayout sets itself to the width of the button, which I'm okay with, but is there any way to make it wide enough to contain all the text without setting particular pixel measurements (like screen percentage in html/css)?
 
Back
Top