【发布时间】:2017-05-31 17:27:10
【问题描述】:
我正在尝试在 imageview 中设置 1080*1920 图像,但它在左侧和右侧显示空白。它在所有分辨率为 480*800,720*1280,768*1280,1080*1920,1440*2560 的设备中显示相同。请检查附加图片另外,我尝试设置 android:adjustViewBounds="true" 但如果我设置 android:scaleType="fitXY" 图像被拉伸,它就不起作用.请帮助我提供一些解决方案,因为我正在尝试所有可能的方法,但直到现在都没有工作。
This is xml layout code :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img_gallery1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/atest"
android:scaleType="fitXY" --> iF i use fitXY then image is streched
android:visibility="visible" />
</RelativeLayout>
【问题讨论】:
-
发布您的布局 xml
-
发布您的 xml 代码。以及您要展示的图片。
标签: android image android-layout android-imageview removing-whitespace