I'm having trouble displaying some text in a dialog. When the user has forgotten their password, I use the "forgot password" TextView
to display a message explaining what happens when they put their email address in. The layout for this is:
<TextView
android:id="@+id/forgotpasswordtextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/forgotpassword"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/md_text_yellow"
android:gravity="right" />
It's inside a <LinearLayout></LinearLayout>
with the following properties:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/base_panel"
android:orientation="vertical"
android:padding="6dip" >
It starts as a one-line view and expands to a four-line view.
Within the dialog constructor, I have a layout instruction:
mParent = LayoutInflater.from(context).inflate(R.layout.login, null);
setContentView(mParent, new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
I changed this to have the dialog height be 600 (it worked—one vertically stretched dialog) and the TextView
is STILL only displaying four lines, so it's not being crushed by its parent.
What could be causing this?
EDIT:
Changing the TextView
to android:textAppearance="?android:attr/textAppearanceSmall"
cuts the string off at the same point, displaying three lines. I am now wondering if this is a string problem and not a TextView
problem.
The original string is:
Please enter your registered email and we will send you details of how to reset your password. If you do not know your email then please contact us.
And it cuts off at:
Please enter your registered email and we will send you details of how to reset your password. If you do not
with small text (three lines) and
Please enter your registered email and we will send you details of how to reset your password. If you do not know
with medium text (four lines).
A new test string I put in is:
0________ 1________ 2________ 3________ 4________ 5________ 6________ 7________ 8________ 9________ 10_______ 11_______ 12_______ 13_______ 14_______ 15_______ 16_______ 17_______
And it cuts off at:
0________ 1________ 2________ 3________ 4________ 5________ 6________ 7________ 8________ 9________ 10_______ 11_______ 12_______ 13_______ 14_______
with small text (five lines) and
0________ 1________ 2________ 3________ 4________ 5________ 6________ 7________ 8________ 9________ 10_______ 11_______
with medium text (six lines).
FURTHER EDIT:
Shortening the string suggests it is cutting off the last line or two. Could be like Android: Last line of textview cut off. Adding a newline to the string file gives me another line, but not the whole string!