<?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參考圖像 –