2

リストビューのカスタムセルにTEXTNUMBERがあります。これは正常に機能しますが、TEXTが1行を超えると、右側の番号も複数行を超えるため、ばかげているように見えます。これを防ぐためのプロパティはありますか?

ここに画像の説明を入力してください

私のXMLは次のとおりです。

<?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="wrap_content"
    android:orientation="horizontal" >
    <TextView
        android:id="@+id/txtOption"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="7"
        android:paddingBottom="5dp"
        android:paddingTop="5dp"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceLarge" />


    <TextView
        android:id="@+id/txtCount"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="3"
        android:paddingBottom="5dp"
        android:paddingLeft="25dp"
        android:paddingRight="15dp"
        android:paddingTop="5dp"
        android:text="[21]"
        android:textAppearance="?android:attr/textAppearanceMedium" />


</LinearLayout>
4

1 に答える 1

1

あなたlayout_weightの見解はキックインしていないようです。そのために、私はあなたがandroid:weightSum="10"あなたのLinearLayout定義の中で定義するのに欠けていると思います。android:layout_width="0dp"また、両方に設定する必要がありますTextView

于 2012-10-29T14:10:49.993 に答える