android – LinearLayout ImageView调整所有图像宽度以适应

我有一个包含3个图像视图的水平线性布局.每个图像视图包含200×200像素的相同图像.这是我的布局xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/image200" />

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/image200" />

        <ImageView
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/image200" />

    </LinearLayout>

</RelativeLayout>

这是它的样子:

注意左边的第三个图像是如何调整大小我假设的,因为没有足够的空间来容纳3x 200像素宽的图像.

我宁愿发生的不是仅缩小最后一张图像,而是将所有三张图像均匀调整大小以使它们都适合整个屏幕.如何设置我的布局以均匀地适合所有三个图像?

谢谢

更新 – 在更改我的设置后,这是什么样的事情:

请注意,图像视图周围的边框仍然是200像素高.为什么会这样?

解决方法

将图像视图的宽度和高度设置为match_parent,并为所有图像视图设置layout_weight = 1.还设置属性android:scaleType =“fitXY”

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...