4

TextViewとImageViewで構成される相対レイアウトがあります。

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"/>
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:adjustViewBounds="true"/>
</RelativeLayout>

次のようになります。

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

私が達成したいのは:

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

これは、ImageViewを高さでTextViewに合わせて拡大縮小することを意味します。Javaコーディングなしでxmlで実行できますか?私が次のようなものを書くことができれば

android:layout_height="match_that_TextView"

それはこの問題を解決するでしょうが、それは私が推測することは不可能です。

4

1 に答える 1

1

RelativeLayout で高さを固定する

于 2012-09-11T15:39:53.977 に答える