【发布时间】:2014-09-08 12:24:47
【问题描述】:
TextView 有一个最奇怪的问题。我有一个很长的文本(它不包含新行,所以 textview 应该自动适应它)。以编程方式设置自定义字体。问题是文本被剪切了。我可以看到视图边缘的字母顶部。文字左边部分被剪掉,不可见。
这是 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" />
这是我应用字体的方式:
descriptionText.setTypeface(Typeface.createFromAsset(getAssets(),
"fonts/okolaksRegular.ttf"));
【问题讨论】:
-
查看此链接 :) 希望对您有所帮助...stackoverflow.com/questions/2197744/…
标签: android textview word-wrap android-typeface