Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.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
Image Android-Layout无法正常工作_Image_Android Layout - Fatal编程技术网

Image Android-Layout无法正常工作

Image Android-Layout无法正常工作,image,android-layout,Image,Android Layout,我想根据屏幕大小加载布局 我的配置 安卓2.2 小屏幕QVGA(240x320),低密度(120) 图像分辨率为240x320 res/layout small/myimg.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" a

我想根据屏幕大小加载布局

我的配置

安卓2.2

小屏幕QVGA(240x320),低密度(120)

图像分辨率为240x320

res/layout small/myimg.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"  
  android:layout_height="fill_parent">

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

但当我运行应用程序时,屏幕并没有完全被图像覆盖,屏幕的左右两侧都有一个小的空白

我也找到了下面的链接,但问题仍然存在

谁能告诉我哪里出了问题

  • 可能你的图像没有覆盖整个屏幕。图像可能有透明的边框,或者没有完全正确的大小。您还可以将
    android:scaleType=“fitXY”
    ImageView

    添加:
  • 建议您使用
    ldpi
    绗缝机,而不是
    small