今天遇到個比較詭異的情況,記錄一下。
我的佈局是這樣的,使用的是LinearLayout佈局,分爲上下兩個模塊,ImageView(上)和TextView(下);
詭異的是listview裏面只有一個子TextView顯示的內容不見了,其它的都是正常顯示
上個效果圖:
沒有顯示全部的名字是【四季豆炒雞什】,當然這是瞎搞的名字,不喜勿噴。
上個TextView的代碼:
<TextView
android:id="@+id/mXFItemtext"
android:layout_width="match_parent"
android:layout_height="@dimen/px48"
android:gravity="center"
android:textSize="@dimen/px33"
android:textStyle="bold"
android:textColor="@android:color/white"
android:maxLines="1"
android:ellipsize="end"/>
簡單明瞭說結果:把android:maxLines="1"改成android:singleLine=“true”
親測已解。