Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 图像视图布局图_Android - Fatal编程技术网

Android 图像视图布局图

Android 图像视图布局图,android,Android,我的问题是我的imageView01看起来太大了,我看不清图片上的内容。我希望它的高度合适 你可以在下面的图片中看到我的意思: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:orientation=

我的问题是我的
imageView01
看起来太大了,我看不清图片上的内容。我希望它的高度合适

你可以在下面的图片中看到我的意思:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              >


    <Gallery
        android:id="@+id/examplegallery" 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="fill_parent"
        android:layout_height="match_parent" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <ImageView
                android:id="@+id/ImageView01"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:scaleType="fitXY" />

            <TextView
                android:id="@+id/tvTextDescription"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceMedium" />
         </LinearLayout>
     </ScrollView>
</LinearLayout>


将此值用于缩放类型。它将均匀缩放图像(保持图像的纵横比),使图像的两个尺寸(宽度和高度)等于或小于视图的相应尺寸(减去填充)。然后图像在视图中居中

    <ImageView
            android:id="@+id/ImageView01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="centerInside" />

复制此xml而不是您的xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              >


    <Gallery
        android:id="@+id/examplegallery" 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="fill_parent"
        android:layout_height="match_parent" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >

            <ImageView
                android:id="@+id/ImageView01"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="fitXY" />

            <TextView
                android:id="@+id/tvTextDescription"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceMedium" />
         </LinearLayout>
     </ScrollView>
</LinearLayout>

将scaletype更改为这个android:scaletype=“matrix”,然后实际图像出现。。