<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="2dp"
android:background="@drawable/cell_background">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="15dp"
android:text="New Text"
android:gravity="center"
android:background="@color/white"
android:id="@+id/textView"/>
</LinearLayout>
我碰到一个问题就来了,TextView
没有显示完整的文本,我绝对不能限制码文本长度(而不是其他任何东西!)。的Android TextView中不显示完整的长文
当我使用setText
与以下字符串:
qwertyuyiopasdfghjklkjsdfhvrtcgwrgcrcrfcwerm,fixcumreiovtreuiocfmruefcmeroiwurewmiohgxiehgiocwrhhhhwemoggruiohwgcioweruhcmrehxrmeihouxe,horhxihuxchfjkhjklsdfhdlkfhdsjflkasdhjfhaskldfhdkljfhsadjfkhdsjfdsakflajdasghsdlkacvnsadohlkfjhdjkflsadhkjfhasdlkfhdsjlkfhdjlkfhasdjfhicnerjsdklfhdjsklfhdsjklfhasdjklvcnsldkjfldksfhajsldkfhdjklsjfhasdjklf789456123
那只能说明:
qwertyuyiopasdfghjklkjsdfhvrtcgwrgcrcrfcwerm,fixcumreiovtreuiocfmruefcmeroiwurewmiohgxiehgiocwrhhhhwemoggruiohwgcioweruhc
但getText
返回完整的字符串的Hierarchy Viewer
截图如图所示!
其实我重新设置代码中的布局参数使得有足够的空间来设置文本。但问题是TextView获得了空间来显示文本,但它只是不显示完整的文本.------ plz参考图像 –