这是界面代码
<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:id="@+id/linearLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android"
     android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    >
        <ImageView 
        android:src="@drawable/home" 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent" 
        android:id="@+id/imageView">
        </ImageView>
    </LinearLayout>
   
这是我activity界面代码
//全屏代码
requestWindowFeature(Window.FEATURE_NO_TITLE);  getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,WindowManager.LayoutParams. FLAG_FULLSCREEN);
setContentView(R.layout.home);
但是显示出来图片在中间上下都是黑色的。没拉伸。不知道什么问题啊。都帮忙看下啊

解决方案 »

  1.   

    那是因为你的activity背景色是黑色,至于你的imageView拉伸问题,android:scaleType="" //这里面参数很多你看看,哪个更适合你
      

  2.   

    <?xml version="1.0" encoding="utf-8"?>
      <LinearLayout android:id="@+id/linearLayout1"  
      android:layout_width="fill_parent"  
      android:layout_height="fill_parent"  
      android:background="@drawable/home" 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
      >
      <ImageView  
      android:src="@drawable/home"  
      android:layout_height="fill_parent"
      android:layout_width="fill_parent"  
      android:id="@+id/imageView">
      </ImageView>
      </LinearLayout>
    红色是修改的部分,这样就行了
      

  3.   

    楼上那个不行,红色部分改后,图片会重叠。
    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.home);
    BitmapDrawable bd = new BitmapDrawable(bitmap);
    bd.setTileModeXY(TileMode.CLAMP , TileMode.CLAMP );
    bd.setDither(true);
    imageView.setBackgroundDrawable(bd); 
    我直接画上去是可以的。不过图片有些小失真