1

画面より長いimageものを表示したい。

私は のImageView中でを使用していscroll viewます。のにスクロールできる白い画面が表示されますが、画像自体は表示されませんheightimage

これが私が使用しているレイアウトxmlです:-

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/scrollView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true"
    tools:context=".MainActivity" >


    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:contentDescription="@string/test_image_content_description"
        android:adjustViewBounds="true"
        android:visibility="visible"
        android:src="@drawable/test_image" />

</ScrollView>

test_image.pngは、アプリケーションのすべてのdrawableフォルダで利用可能なファイルです。

どんな助けでも大歓迎です!

4

3 に答える 3

0

android:scaleType="center"スケールなしで画像を中央に配置するなど、スケールタイプをイメージビューに追加してから、イメージandroid:adjustViewBounds="true"ビューからコードを削除する必要があります。詳細はご覧くださいImageView.ScaleType。ありがとう

于 2013-08-28T08:56:23.810 に答える
0

あなたのScrollView

android:layout_height="wrap_content"に変更android:layout_height="math_parent"

于 2013-08-28T08:47:53.763 に答える