这是界面代码
<?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);
但是显示出来图片在中间上下都是黑色的。没拉伸。不知道什么问题啊。都帮忙看下啊
<?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);
但是显示出来图片在中间上下都是黑色的。没拉伸。不知道什么问题啊。都帮忙看下啊
<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>
红色是修改的部分,这样就行了
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);
我直接画上去是可以的。不过图片有些小失真