textview cutting off a letter in android

2020-06-30 05:20发布

http://dl.dropbox.com/u/24856/Screenshots/android/cutoff.png

this is a screen shot from my android. the text is "asd". however the "d" is slightly cut off. here is the relevant view:

        <TextView
            android:id="@+id/stuff"
            android:padding="2dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/other_stuff"
            android:layout_marginTop="33dp"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textStyle="italic" />

any idea as to what is causing this ?

标签: android
11条回答
Luminary・发光体
2楼-- · 2020-06-30 06:02

I fixed it with setting the width of TextView to fill_parent instead of wrap_content...

查看更多
聊天终结者
3楼-- · 2020-06-30 06:02

the problem here is, the italic property. You have to set a particular width for your textview.

查看更多
时光不老,我们不散
4楼-- · 2020-06-30 06:03

I suspect the issue would not occur if you were not using italic text. I'd test that out first, and if using non-italic text renders it correctly, then it looks like a rendering issue, that would need working around with extra padding in the TextView to allow space for the italic letters.

查看更多
一夜七次
5楼-- · 2020-06-30 06:05

You can use .

android:layout_width="fill_parent"

istead of

android:layout_width="wrap_content"
查看更多
别忘想泡老子
6楼-- · 2020-06-30 06:07

none of the mentioned suggestions work, ended up with a hacky solution which is adding a white space after the last italicized character

查看更多
登录 后发表回答