0
私はリストビューを持っています。リストビューには、左側に小さなテキストビューと長いテキストビュー(両方にテキストが変わります)があり、右側にはイメージビューがあります。問題は、長いtextviewが長すぎると、2行目に折り返す前に右側の画像ビューを圧縮するということです。両方のtextviewsは各行にさまざまな長さがあるので、私はその長さの修正dp値を設定することはできません。イメージビューが圧縮されないと私は何をすることができますか?アンドロイドのレイアウトの幅を右のボーダーを基準にしてどのように設定するのですか?
PS:
<TextView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:layout_gravity="center_vertical"/>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:layout_gravity="center_vertical"/>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/image"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:focusable="false"/>
</RelativeLayout>
android:layout_toLeftOf = "@ + id/image"を追加しましたが、何も変更されませんでした。右側の画像はまだ圧縮されています。 layout_widthをfill_parentに変更すると、画像はまったく表示されません。 – HardCoder
ああ、私はImageViewがRelativeLayoutの中にあったことに気付かず、IDをRelativeLayoutに与え、TextViewをRelativeLayoutの代わりに残すように設定しました。 – gngr44
私はそれを試みましたが、残念ながらそれは動作しませんでした。私は本当に気にしませんrelativelayout、私はちょうど2つのtextviews右の画像と2番目のtextviewは、画像を圧縮しないようにします。 – HardCoder