画像ボタンがあります。必要に応じて、これをカスタム ビューに置き換えることができます。Image Button の高さを Fill_parent として指定する必要があります。画像が画面内の利用可能な高さまで伸びるようにします。これを行うとき、幅を緩めたくありません。高さとしては最小にしてほしいし、高さ以上なら問題ない。こんなに長くいたくない。これを行う間、アスペクト比も維持したいと思います。この種のビューを取得するために調整する必要があるパラメーターを教えてください。この点に関するあらゆる種類の助けをいただければ幸いです。ご協力いただき、ありがとうございました。
編集:以下は、高さがfill_parentの水平スクロールビューを作成しようとしている完全なxmlで、その高さに収まり、アスペクト比に従って幅を拡大または縮小する画像で埋めようとしています。画像が小さくても横スクロールビューで高さが常に占有されるように拡大したい。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:layout_weight="3"
android:background="#666666">
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:layout_weight="7"
android:background="#888888">
<HorizontalScrollView android:id="@+id/horizontalScrollView1"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView android:src="@drawable/image1"
android:layout_weight="1" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:adjustViewBounds="true"
android:id="@+id/attachimagebutton_2" />
<ImageView android:src="@drawable/image2"
android:layout_weight="1" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:adjustViewBounds="true"
android:id="@+id/attachimagebutton_2" />
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
</LinearLayout>