根据imageview制作最小高度

时间:2015-07-08 09:53:04

标签: android android-layout imageview height

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:minHeight="400dp"
    android:background="@android:color/black"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/invitation_imageview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:layout_margin="1dp"
        android:scaleType="centerCrop"
       />

    <ImageView
        android:id="@+id/invitation_avatar_view_1"
        android:layout_width="28dp"
        android:layout_height="28dp"
        android:scaleType="centerCrop"
        android:layout_margin="6dp" />

</LinearLayout>

大家好,这是我的布局,我有一个问题,如果我把较小的图像,例如60 * 60 - px放到这个布局,我的视图只有大约60像素高。但是图像被拉伸了,我添加了最小高度到布局,但它并没有完全解决我的问题,因为根据设备的宽度,这个数字可能会有所不同。我应该怎么做才能始终显示我的整个图像视图并且还有包装内容,而不是玩一些minHeight?

0 个答案:

没有答案