How to display an image full size with ImageView?

大兔子大兔子 提交于 2019-11-29 15:34:43

add a scaleType to your ImageView

 <ImageView
     android:scaleType="center"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/screen1_logo" />

from the doc android:scaleType="center"

Center the image in the view, but perform no scaling.

Try adding a scaleType attribute to your view:

android:scaleType=""

The available options can be found here:

http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

Please Define scale type as fitXY

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

Try adding in xml file (ImageView properties) android:adjustViewBounds="true".

<ImageView
    android:id="@+id/photoViewer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!