0

I have the strangest problem with a TextView. I have a pretty long text (it does not contain new lines so the textview should fit it automatically). A custom typeface is set programmatically. The problem is that the text is cut. I can see the top of the letters on the edge of the view. The left part of the text is cut and it is not visible.

Here is the XML:

<TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/imageView1"
        android:layout_alignRight="@+id/imageView2"
        android:layout_below="@+id/relativeLayout2"
        android:layout_centerHorizontal="true"
        android:paddingLeft="5dp"
        android:paddingRight="5dp"
        android:background="#FFFFFF"
        android:gravity="center"
        android:singleLine="false" /> 

And here is how I apply the font:

descriptionText.setTypeface(Typeface.createFromAsset(getAssets(),
                "fonts/okolaksRegular.ttf"));
double-beep
  • 5,031
  • 17
  • 33
  • 41
dephinera
  • 3,703
  • 11
  • 41
  • 75
  • Check this link :) Hope it helps ... http://stackoverflow.com/questions/2197744/android-textview-text-not-getting-wrapped – Joe Augustine Sep 08 '14 at 12:33

1 Answers1

0

I found what was causing this problem. There was this item in the AppTheme declaration: <item name="android:height">?android:attr/actionBarSize</item>

After I removed it, it worked perfectly.

dephinera
  • 3,703
  • 11
  • 41
  • 75