Android TextView has stopped wrapping text

I've spent quite a bit of time looking for a solution but haven't found anything similar to what I'm experiencing. When I run my app on my G2, none of my text comments wrap text. (No matter how big the views are.) If I run it on an emulator, they wrap appropriately. None of my other apps seem to have this issue when deployed to my G2. I have power related to my devices, recreated layouts, etc. It even seems to affect the standard alert dialog in this particular application. This happens in all my actions. Has anyone seen something like this or does anyone know what I should be looking at?

Some code as requested ...

AlertDialog.Builder eula = new AlertDialog.Builder(activity)
            .setTitle(R.string.eula_title)
            .setIcon(android.R.drawable.ic_dialog_info)
            .setMessage(R.string.eula_text)
            .setCancelable(accepted)
            .setPositiveButton(R.string.eula_accept,
                        new android.content.DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                                setAcceptedEula(activity);
                                dialog.dismiss();
                                mHandler.post(mSplashScreen.launch);
                            }
                        })
            .setNegativeButton(R.string.eula_decline,
                        new android.content.DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.cancel();
                                activity.finish();
                            }
                        });
    eula.show();

      

The standard warning dialog will not wrap text. It shows one line that keeps track of the view.

+2


source to share


2 answers


OK, so I figured it out.
I have a theme applied to my app with a parent theme Theme.Holo

.

When I deleted this thread as a parent mine textviews

started wrapping again! I do not know why others then, when launched on a device that does not understand Theme.Holo

, are confused.



So, I just created an additional directory values-v13

and changed my themes. Sorry for the trouble.

+7


source


In addition to Larry Mackenzie's answer, I had to set the appropriate parameters in the TextView:

android:ellipsize="none"
android:maxLines="20"
android:scrollHorizontally="false"
android:singleLine="false" 

      



Example:

<TextView                  
  android:textColor="@color/white"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:ellipsize="none"
  android:maxLines="20"
  android:scrollHorizontally="false"
  android:singleLine="false"
  android:text="@string/my_text" />

      

0


source







All Articles